[PATCH v2] drm/amd/display: Use root connector's colorspace property for MST

Pillai, Aurabindo Aurabindo.Pillai at amd.com
Thu Jul 13 20:51:15 UTC 2023


[Public]

Reviewed-by: Aurabindo Pillai <aurabindo.pillai at amd.com>

--

Regards,
Jay
________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Harry Wentland <harry.wentland at amd.com>
Sent: Thursday, July 13, 2023 3:58 PM
To: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
Cc: Wentland, Harry <Harry.Wentland at amd.com>
Subject: [PATCH v2] drm/amd/display: Use root connector's colorspace property for MST

After driver init we shouldn't create new properties. Doing so
will lead to a warning storm from __drm_mode_object_add.

We don't really need to create the property for MST connectors.
Re-using the mst_root connector's property is fine.

v2: Add curly braces to avoid possibly 'else' confusion

Signed-off-by: Harry Wentland <harry.wentland at amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 28f8ac6007fb..f6dab6226b29 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7357,8 +7357,14 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
                         drm_connector_attach_colorspace_property(&aconnector->base);
         } else if (connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
                    connector_type == DRM_MODE_CONNECTOR_eDP) {
-               if (!drm_mode_create_dp_colorspace_property(&aconnector->base, supported_colorspaces))
-                       drm_connector_attach_colorspace_property(&aconnector->base);
+               if (!aconnector->mst_root) {
+                       if (!drm_mode_create_dp_colorspace_property(&aconnector->base, supported_colorspaces))
+                               drm_connector_attach_colorspace_property(&aconnector->base);
+               } else { /* use root connector's property */
+                       if (aconnector->mst_root->base.colorspace_property)
+                               drm_connector_attach_colorspace_property(&aconnector->mst_root->base);
+               }
+
         }

         if (connector_type == DRM_MODE_CONNECTOR_HDMIA ||
--
2.41.0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20230713/26476b1e/attachment-0001.htm>


More information about the amd-gfx mailing list