[PATCH v3 07/11] drm/nouveau/dp_mst: Expose a connector to kernel users after it's properly initialized

Jani Nikula jani.nikula at linux.intel.com
Thu Dec 12 10:14:20 UTC 2024


On Thu, 12 Dec 2024, Imre Deak <imre.deak at intel.com> wrote:
> After a connector is added to the drm_mode_config::connector_list, it's
> visible to any in-kernel users looking up connectors via the above list.
> Make sure that the connector is properly initialized before such
> look-ups, by initializing the connector with
> drm_connector_dynamic_register() - which doesn't add the connector to
> the list - and registering it with drm_connector_dynamic_register() -
> which adds the connector to the list - after the initialization is
> complete.
>
> Cc: Karol Herbst <kherbst at redhat.com>
> Cc: Lyude Paul <lyude at redhat.com>
> Cc: Danilo Krummrich <dakr at kernel.org>
> Signed-off-by: Imre Deak <imre.deak at intel.com>

Reviewed-by: Jani Nikula <jani.nikula at intel.com>

> ---
>  drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index eed579a6c858b..8097249612bc7 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -1265,8 +1265,8 @@ nv50_mstc_new(struct nv50_mstm *mstm, struct drm_dp_mst_port *port,
>  	mstc->mstm = mstm;
>  	mstc->port = port;
>  
> -	ret = drm_connector_init(dev, &mstc->connector, &nv50_mstc,
> -				 DRM_MODE_CONNECTOR_DisplayPort);
> +	ret = drm_connector_dynamic_init(dev, &mstc->connector, &nv50_mstc,
> +					 DRM_MODE_CONNECTOR_DisplayPort, NULL);
>  	if (ret) {
>  		kfree(*pmstc);
>  		*pmstc = NULL;

-- 
Jani Nikula, Intel


More information about the Intel-gfx mailing list