Re: [PATCH 2/2] drm/nouveau/kms: Initialize primary_crc for RG CRC capture on GB20x
From: Lyude Paul
Date: Mon Nov 30 2026 - 19:07:16 EST
Reviewed-by: Lyude Paul <lyude.paul@xxxxxxxxxxxxx>
On Thu, 2026-11-19 at 09:03 -0800, Ian Rogers wrote:
> In crcca7d_set_src(), selecting the "rg" CRC source passes
> NV50_CRC_SOURCE_TYPE_RG, hitting the default case without
> initializing
> primary_crc before packing it into HEAD_SET_CRC_CONTROL's PRIMARY_CRC
> field.
>
> Initialize primary_crc to
> NVCA7D_HEAD_SET_CRC_CONTROL_PRIMARY_CRC_NONE
> in the default branch, matching crcc37d_set_src() where RG CRC
> capture
> leaves PRIMARY_CRC set to NONE.
>
> Found via Clang -Wconditional-uninitialized on an x86_64 allyesconfig
> build. Verified by building
> drivers/gpu/drm/nouveau/dispnv50/crcca7d.o
> with LLVM=1 W=1 (-Werror) and -Wconditional-uninitialized; not
> runtime-tested on NVIDIA Blackwell (GB20x) hardware.
>
> Fixes: 6cc6e08d4542 ("drm/nouveau/kms: add support for GB20x")
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
> ---
> drivers/gpu/drm/nouveau/dispnv50/crcca7d.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/crcca7d.c
> b/drivers/gpu/drm/nouveau/dispnv50/crcca7d.c
> index 912f59aebe87..02db81e5c8a3 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/crcca7d.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/crcca7d.c
> @@ -65,6 +65,7 @@ crcca7d_set_src(struct nv50_head *head, int or,
> enum nv50_crc_source_type source
> primary_crc =
> NVCA7D_HEAD_SET_CRC_CONTROL_PRIMARY_CRC_SF;
> break;
> default:
> + primary_crc =
> NVCA7D_HEAD_SET_CRC_CONTROL_PRIMARY_CRC_NONE;
> break;
> }
>