[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cf9b3cd8654c25c13d5f5130c0753d5480144a43.camel@nvidia.com>
Date: Wed, 20 Sep 2023 21:33:23 +0000
From: Timur Tabi <ttabi@...dia.com>
To: "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"nouveau@...ts.freedesktop.org" <nouveau@...ts.freedesktop.org>,
"lyude@...hat.com" <lyude@...hat.com>
CC: "daniel@...ll.ch" <daniel@...ll.ch>,
"Wayne.Lin@....com" <Wayne.Lin@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [Nouveau] [PATCH v3 42/44] drm/nouveau/kms/nv50-: create
connectors based on nvkm info
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()?
Powered by blists - more mailing lists