<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#008000;margin:15pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[Public]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com><br>
</div>
<div class="elementToProof">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
--</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Jay<br>
</div>
</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Harry Wentland <harry.wentland@amd.com><br>
<b>Sent:</b> Thursday, July 13, 2023 3:58 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Wentland, Harry <Harry.Wentland@amd.com><br>
<b>Subject:</b> [PATCH v2] drm/amd/display: Use root connector's colorspace property for MST</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">After driver init we shouldn't create new properties. Doing so<br>
will lead to a warning storm from __drm_mode_object_add.<br>
<br>
We don't really need to create the property for MST connectors.<br>
Re-using the mst_root connector's property is fine.<br>
<br>
v2: Add curly braces to avoid possibly 'else' confusion<br>
<br>
Signed-off-by: Harry Wentland <harry.wentland@amd.com><br>
---<br>
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 ++++++++--<br>
 1 file changed, 8 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
index 28f8ac6007fb..f6dab6226b29 100644<br>
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
@@ -7357,8 +7357,14 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,<br>
                         drm_connector_attach_colorspace_property(&aconnector->base);<br>
         } else if (connector_type == DRM_MODE_CONNECTOR_DisplayPort ||<br>
                    connector_type == DRM_MODE_CONNECTOR_eDP) {<br>
-               if (!drm_mode_create_dp_colorspace_property(&aconnector->base, supported_colorspaces))<br>
-                       drm_connector_attach_colorspace_property(&aconnector->base);<br>
+               if (!aconnector->mst_root) {<br>
+                       if (!drm_mode_create_dp_colorspace_property(&aconnector->base, supported_colorspaces))<br>
+                               drm_connector_attach_colorspace_property(&aconnector->base);<br>
+               } else { /* use root connector's property */<br>
+                       if (aconnector->mst_root->base.colorspace_property)<br>
+                               drm_connector_attach_colorspace_property(&aconnector->mst_root->base);<br>
+               }<br>
+<br>
         }<br>
 <br>
         if (connector_type == DRM_MODE_CONNECTOR_HDMIA ||<br>
-- <br>
2.41.0<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>