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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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()?




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux