* [PATCH v2 1/3] drm/nouveau: Handle NVIF_CONN_TV in nouveau_connector_create()
2026-12-03 17:27 [PATCH v2 0/3] drm/nouveau: Three fixes from Clang warning audit Ian Rogers
@ 2026-12-03 17:27 ` Ian Rogers
2026-12-03 17:27 ` [PATCH v2 2/3] drm/nouveau: Fix error cleanup in nouveau_connector_create() default case Ian Rogers
2026-12-03 17:27 ` [PATCH v2 3/3] drm/nouveau/kms: Initialize primary_crc for RG CRC capture on GB20x Ian Rogers
2 siblings, 0 replies; 4+ messages in thread
From: Ian Rogers @ 2026-12-03 17:27 UTC (permalink / raw)
To: Lyude Paul, Danilo Krummrich, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Cc: Lyude Paul, dri-devel, nouveau, linux-kernel, llvm, Elkin Cruz,
Ian Rogers
In nouveau_connector_create(), the switch translating nvif connector
types (nv_connector->conn.info.type) to DCB connector types omits
NVIF_CONN_TV, even though nvkm_uconn_new() maps DCB TV connectors to
NVIF_CONN_V0_TV -> NVIF_CONN_TV and the rest of nouveau_connector.c
handles DCB_CONNECTOR_TV_0.
Map NVIF_CONN_TV to DCB_CONNECTOR_TV_0, matching the surrounding case
formatting.
Found with Clang's -Wswitch-enum on an x86_64 allyesconfig build; Gemini
helped audit the warning and draft the patch and commit message.
Compile-tested on nouveau_connector.o with LLVM=1 W=1 (-Werror) and
-Wswitch-enum; not runtime-tested because NVIDIA GPU hardware with a TV
connector is not available.
Fixes: 8b7d92cad953 ("drm/nouveau/kms/nv50-: create connectors based on nvkm info")
Signed-off-by: Ian Rogers <irogers@google.com>
---
Notes:
v2:
- Split from v1 patch 1/2 and matched the surrounding switch column
alignment (Lyude Paul).
v1: https://lore.kernel.org/r/f0db7ca640d19d1021b4031b08be426532425095.1795106937.git.irogers@google.com
drivers/gpu/drm/nouveau/nouveau_connector.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index cc3caf8de64b..d71a920f0a3d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -1394,6 +1394,7 @@ nouveau_connector_create(struct drm_device *dev, int index)
switch (nv_connector->conn.info.type) {
case NVIF_CONN_VGA : type = DCB_CONNECTOR_VGA; break;
+ case NVIF_CONN_TV : type = DCB_CONNECTOR_TV_0; break;
case NVIF_CONN_DVI_I : type = DCB_CONNECTOR_DVI_I; break;
case NVIF_CONN_DVI_D : type = DCB_CONNECTOR_DVI_D; break;
case NVIF_CONN_LVDS : type = DCB_CONNECTOR_LVDS; break;
--
2.56.1.911.g883d8bcb20-goog
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v2 2/3] drm/nouveau: Fix error cleanup in nouveau_connector_create() default case
2026-12-03 17:27 [PATCH v2 0/3] drm/nouveau: Three fixes from Clang warning audit Ian Rogers
2026-12-03 17:27 ` [PATCH v2 1/3] drm/nouveau: Handle NVIF_CONN_TV in nouveau_connector_create() Ian Rogers
@ 2026-12-03 17:27 ` Ian Rogers
2026-12-03 17:27 ` [PATCH v2 3/3] drm/nouveau/kms: Initialize primary_crc for RG CRC capture on GB20x Ian Rogers
2 siblings, 0 replies; 4+ messages in thread
From: Ian Rogers @ 2026-12-03 17:27 UTC (permalink / raw)
To: Lyude Paul, Danilo Krummrich, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Cc: Lyude Paul, dri-devel, nouveau, linux-kernel, llvm, Elkin Cruz,
Ian Rogers
In nouveau_connector_create(), the default branch of the connector-type
switch returns NULL without destroying nv_connector->conn or freeing
nv_connector. Both callers (nv50_display_create() and
nv04_display_create()) only check IS_ERR(connector) and immediately
dereference connector on a NULL return.
Clean up nv_connector->conn and free nv_connector before returning
ERR_PTR(-EINVAL).
Found by code inspection while reviewing Clang's -Wswitch-enum warning
in nouveau_connector_create(); Gemini helped draft the patch and commit
message. Compile-tested on nouveau_connector.o with LLVM=1 W=1
(-Werror); not runtime-tested on NVIDIA GPU hardware.
Fixes: 8b7d92cad953 ("drm/nouveau/kms/nv50-: create connectors based on nvkm info")
Signed-off-by: Ian Rogers <irogers@google.com>
---
Notes:
v2:
- Split out from v1 patch 1/2 (Lyude Paul).
v1: https://lore.kernel.org/r/f0db7ca640d19d1021b4031b08be426532425095.1795106937.git.irogers@google.com
drivers/gpu/drm/nouveau/nouveau_connector.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index d71a920f0a3d..1e2ce2b46ad4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -1404,7 +1404,9 @@ nouveau_connector_create(struct drm_device *dev, int index)
case NVIF_CONN_HDMI : type = DCB_CONNECTOR_HDMI_0; break;
default:
WARN_ON(1);
- return NULL;
+ nvif_conn_dtor(&nv_connector->conn);
+ kfree(nv_connector);
+ return ERR_PTR(-EINVAL);
}
nv_connector->type = type;
--
2.56.1.911.g883d8bcb20-goog
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v2 3/3] drm/nouveau/kms: Initialize primary_crc for RG CRC capture on GB20x
2026-12-03 17:27 [PATCH v2 0/3] drm/nouveau: Three fixes from Clang warning audit Ian Rogers
2026-12-03 17:27 ` [PATCH v2 1/3] drm/nouveau: Handle NVIF_CONN_TV in nouveau_connector_create() Ian Rogers
2026-12-03 17:27 ` [PATCH v2 2/3] drm/nouveau: Fix error cleanup in nouveau_connector_create() default case Ian Rogers
@ 2026-12-03 17:27 ` Ian Rogers
2 siblings, 0 replies; 4+ messages in thread
From: Ian Rogers @ 2026-12-03 17:27 UTC (permalink / raw)
To: Lyude Paul, Danilo Krummrich, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Cc: Lyude Paul, dri-devel, nouveau, linux-kernel, llvm, Elkin Cruz,
Ian Rogers
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; Gemini helped verify the crcc37d_set_src() counterpart and draft
the patch and commit message. 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")
Reviewed-by: Lyude Paul <lyude.paul@maintainer.cc>
Signed-off-by: Ian Rogers <irogers@google.com>
---
Notes:
v2:
- Unchanged from v1 patch 2/2; carried Reviewed-by from Lyude Paul.
v1: https://lore.kernel.org/r/8b8db80fa775d701fc94bf9e4aa4b0cc577febf3.1795106937.git.irogers@google.com
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;
}
--
2.56.1.911.g883d8bcb20-goog
^ permalink raw reply [flat|nested] 4+ messages in thread