[Nouveau] [PATCH v3 42/44] drm/nouveau/kms/nv50-: create connectors based on nvkm info

Timur Tabi ttabi at nvidia.com
Wed Sep 20 21:33:23 UTC 2023


On Tue, 2023-09-19 at 17:56 -0400, Lyude Paul wrote:
> +                       NVIF_CONN_VGA,
> +                       NVIF_CONN_TV,
> +                       NVIF_CONN_DVI_I,
> +                       NVIF_CONN_DVI_D,
> +                       NVIF_CONN_LVDS,
> +                       NVIF_CONN_LVDS_SPWG,
> +                       NVIF_CONN_HDMI,
> +                       NVIF_CONN_DP,
> +                       NVIF_CONN_EDP,
> +               } type;
> +       } info;
>  };
>  
>  int nvif_conn_ctor(struct nvif_disp *, const char *name, int id, struct
> nvif_conn *);
> diff --git a/drivers/gpu/drm/nouveau/include/nvif/if0011.h
> b/drivers/gpu/drm/nouveau/include/nvif/if0011.h
> index 0c25288a5a789..3ed0ddd75bd8f 100644
> --- a/drivers/gpu/drm/nouveau/include/nvif/if0011.h
> +++ b/drivers/gpu/drm/nouveau/include/nvif/if0011.h
> @@ -7,6 +7,16 @@ union nvif_conn_args {
>                 __u8 version;
>                 __u8 id;        /* DCB connector table index. */
>                 __u8 pad02[6];
> +#define NVIF_CONN_V0_VGA       0x00
> +#define NVIF_CONN_V0_TV        0x01
> +#define NVIF_CONN_V0_DVI_I     0x02
> +#define NVIF_CONN_V0_DVI_D     0x03
> +#define NVIF_CONN_V0_LVDS      0x04
> +#define NVIF_CONN_V0_LVDS_SPWG 0x05
> +#define NVIF_CONN_V0_HDMI      0x06
> +#define NVIF_CONN_V0_DP        0x07
> +#define NVIF_CONN_V0_EDP       0x08

Wouldn't it be simpler to just ensure that the enums have the same values as
the macros, so that we don't need the switch statement in nvif_conn_ctor()?


More information about the Nouveau mailing list