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 <[email protected]>
---

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.irog...@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

Reply via email to