Skip to content

Commit 6fe7b1d

Browse files
committed
drm/i915/dp_mst: Expose a connector to kernel users after it's properly initialized
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: - Rebase on the change which moves adding the connector to the connector list only later when calling drm_connector_dynamic_register(). v3: - Rebase on drm-misc-next, due to a trivial conflict with commit 5503f81 ("drm/i915/mst: unify MST topology callback naming ..."), which is only in drm-intel-next. - Fix s/drm_connector_dynamic_register()/drm_connector_dynamic_init() typo in the commit log. Cc: Lyude Paul <[email protected]> Reviewed-by: Rodrigo Vivi <[email protected]> (v1) Reviewed-by: Lyude Paul <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Imre Deak <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 0f7c05b commit 6fe7b1d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

drivers/gpu/drm/i915/display/intel_dp_mst.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,6 +1715,8 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
17151715
if (!intel_connector)
17161716
return NULL;
17171717

1718+
connector = &intel_connector->base;
1719+
17181720
intel_connector->get_hw_state = intel_dp_mst_get_hw_state;
17191721
intel_connector->sync_state = intel_dp_connector_sync_state;
17201722
intel_connector->mst_port = intel_dp;
@@ -1723,20 +1725,19 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
17231725

17241726
intel_dp_init_modeset_retry_work(intel_connector);
17251727

1726-
intel_connector->dp.dsc_decompression_aux = drm_dp_mst_dsc_aux_for_port(port);
1727-
intel_dp_mst_read_decompression_port_dsc_caps(intel_dp, intel_connector);
1728-
intel_connector->dp.dsc_hblank_expansion_quirk =
1729-
detect_dsc_hblank_expansion_quirk(intel_connector);
1730-
1731-
connector = &intel_connector->base;
1732-
ret = drm_connector_init(dev, connector, &intel_dp_mst_connector_funcs,
1733-
DRM_MODE_CONNECTOR_DisplayPort);
1728+
ret = drm_connector_dynamic_init(&dev_priv->drm, connector, &intel_dp_mst_connector_funcs,
1729+
DRM_MODE_CONNECTOR_DisplayPort, NULL);
17341730
if (ret) {
17351731
drm_dp_mst_put_port_malloc(port);
17361732
intel_connector_free(intel_connector);
17371733
return NULL;
17381734
}
17391735

1736+
intel_connector->dp.dsc_decompression_aux = drm_dp_mst_dsc_aux_for_port(port);
1737+
intel_dp_mst_read_decompression_port_dsc_caps(intel_dp, intel_connector);
1738+
intel_connector->dp.dsc_hblank_expansion_quirk =
1739+
detect_dsc_hblank_expansion_quirk(intel_connector);
1740+
17401741
drm_connector_helper_add(connector, &intel_dp_mst_connector_helper_funcs);
17411742

17421743
for_each_pipe(dev_priv, pipe) {

0 commit comments

Comments
 (0)