]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/nouveau/dp_mst: Expose a connector to kernel users after it's properly initialized
authorImre Deak <imre.deak@intel.com>
Wed, 11 Dec 2024 23:03:24 +0000 (01:03 +0200)
committerImre Deak <imre.deak@intel.com>
Tue, 17 Dec 2024 14:03:53 +0000 (16:03 +0200)
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_init() - 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.

v2: Fix s/drm_connector_dynamic_register()/drm_connector_dynamic_init()
    typo in the commit log.

Cc: Karol Herbst <kherbst@redhat.com>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241211230328.4012496-8-imre.deak@intel.com
drivers/gpu/drm/nouveau/dispnv50/disp.c

index eed579a6c858b658e0ce4c90670c057bd05d27e4..8097249612bc720b602d09410fe7f00a5102e136 100644 (file)
@@ -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;