]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915/dp_mst: Fix race between connector registration and setup
authorImre Deak <imre.deak@intel.com>
Sun, 29 Oct 2023 23:13:08 +0000 (01:13 +0200)
committerImre Deak <imre.deak@intel.com>
Wed, 8 Nov 2023 15:22:04 +0000 (17:22 +0200)
After drm_connector_init() is called the connector is visible to the
rest of the kernel via the drm_mode_config::connector_list. Make
sure that the DSC AUX device and capabilities are setup by that time.

Another race condition is adding the connector to the connector list
before drm_connector_helper_add() sets the connector helper functions.
That's an unrelated issue, for which the fix is for a follow-up. One
solution would be adding the connector to the connector list only
during its registration in drm_connector_register().

Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Fixes: 808b43fa7e56 ("drm/i915/dp_mst: Set connector DSC capabilities and decompression AUX")
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231030155843.2251023-2-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_dp_mst.c

index de608c8ee7b965b4748d7e228af98d88f0bf34ce..4625900416e9e83d2d589a193ebd086dfa065bcc 100644 (file)
@@ -1168,6 +1168,14 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
        intel_connector->port = port;
        drm_dp_mst_get_port_malloc(port);
 
+       /*
+        * TODO: set the AUX for the actual MST port decompressing the stream.
+        * At the moment the driver only supports enabling this globally in the
+        * first downstream MST branch, via intel_dp's (root port) AUX.
+        */
+       intel_connector->dp.dsc_decompression_aux = &intel_dp->aux;
+       intel_dp_mst_read_decompression_port_dsc_caps(intel_dp, intel_connector);
+
        connector = &intel_connector->base;
        ret = drm_connector_init(dev, connector, &intel_dp_mst_connector_funcs,
                                 DRM_MODE_CONNECTOR_DisplayPort);
@@ -1179,14 +1187,6 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
 
        drm_connector_helper_add(connector, &intel_dp_mst_connector_helper_funcs);
 
-       /*
-        * TODO: set the AUX for the actual MST port decompressing the stream.
-        * At the moment the driver only supports enabling this globally in the
-        * first downstream MST branch, via intel_dp's (root port) AUX.
-        */
-       intel_connector->dp.dsc_decompression_aux = &intel_dp->aux;
-       intel_dp_mst_read_decompression_port_dsc_caps(intel_dp, intel_connector);
-
        for_each_pipe(dev_priv, pipe) {
                struct drm_encoder *enc =
                        &intel_dp->mst_encoders[pipe]->base.base;