On 7/14/23 18:52, Michel Dänzer wrote: > On 7/13/23 21:58, Harry Wentland wrote: >> 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 > > I'm still hitting WARNINGs with this, see attachment. It's because drm_connector_attach_colorspace_property tries attaching the property to the MST root connector again, instead of to the newly created MST connector. I tried the attached patch on top and didn't get any WARNINGs, but for some reason the MST connector for my external monitor never showed up to user space. Not sure what's going on there. -- Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer
From 18edb92dddb67e234fe7002ae7d0fb8bfd74642f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@xxxxxxxxxx> Date: Fri, 28 Jul 2023 12:23:13 +0200 Subject: [PATCH] drm/amd/display: Fix attaching root colorspace property to MST connector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit drm_connector_attach_colorspace_property tried attaching the property to the mst_root connector again, which hit a WARNING in drm_object_attach_property. Fix this by calling drm_object_attach_property directly with appropriate parameters. Signed-off-by: Michel Dänzer <mdaenzer@xxxxxxxxxx> --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++-- 1 file changed, 5 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 df30204a2a1a..447576fb7420 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -7302,8 +7302,11 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, 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 (aconnector->mst_root->base.colorspace_property) { + drm_object_attach_property(&aconnector->base.base, + aconnector->mst_root->base.colorspace_property, + DRM_MODE_COLORIMETRY_DEFAULT); + } } } -- 2.40.1