From: "Jan Claußen" <jan.claussen10@web.de>
To: Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Luca Ceresoli <luca.ceresoli@bootlin.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Cc: "Jan Claußen" <jan.claussen10@web.de>,
"Javier Martinez Canillas" <javierm@redhat.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH RFC] drm/bridge: connector: Support the colorspace property for HDMI
Date: Sun, 11 Oct 2026 13:20:22 +0000 [thread overview]
Message-ID: <20261011132024.2833-1-jan.claussen10@web.de> (raw)
Bridge connectors for HDMI do not expose the colorspace property,
so userspace cannot signal the colorimetry e.g. BT.2020 for HDR.
KWin requires the property before it offers the HDR toggle.
Attach the property for HDMI bridge connectors, next to the other HDMI
properties set up by drmm_connector_hdmi_init().
Force a modeset when the property changes so the new colorimetry
reaches the sink, as vc4 does in its connector atomic_check.
After toggling HDR on, modetest shows that the correct BT.2020 color
space is loaded. After toggling it off, it loads the default color space
again.
Tested in Plasma 6.7.5 on a Radxa Rock 5B (RK3588) with an LG OLED55B87LC.
Suggested-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Jan Claußen <jan.claussen10@web.de>
---
.../gpu/drm/display/drm_bridge_connector.c | 20 +++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index 81f3e26f6fdf..0639fe094b10 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -412,6 +412,20 @@ drm_bridge_connector_mode_valid(struct drm_connector *connector,
static int drm_bridge_connector_atomic_check(struct drm_connector *connector,
struct drm_atomic_commit *state)
{
+ struct drm_connector_state *old_state =
+ drm_atomic_get_old_connector_state(state, connector);
+ struct drm_connector_state *new_state =
+ drm_atomic_get_new_connector_state(state, connector);
+ struct drm_crtc_state *crtc_state;
+
+ if (old_state->colorspace != new_state->colorspace) {
+ crtc_state = drm_atomic_get_crtc_state(state, new_state->crtc);
+ if (IS_ERR(crtc_state))
+ return PTR_ERR(crtc_state);
+
+ crtc_state->mode_changed = true;
+ }
+
struct drm_bridge_connector *bridge_connector =
to_drm_bridge_connector(connector);
@@ -1079,6 +1093,12 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
connector_type, ddc);
if (ret)
return ERR_PTR(ret);
+
+ ret = drm_mode_create_hdmi_colorspace_property(connector, 0);
+ if (ret)
+ return ERR_PTR(ret);
+
+ drm_connector_attach_colorspace_property(connector);
} else {
ret = drmm_connector_init(drm, connector,
&drm_bridge_connector_funcs,
--
Hi,
after testing the patch in the link below,
https://patchew.org/linux/20260805153416.8459-1-royalnet026@gmail.com/
which attaches the bridge connector inside the bind function of the
Rockchip QP driver glue code, I realized that the colors looked washed out,
when the HDR mode was enabled in KDE Plasma. I found a supposed solution,
which was comparing the old and new colorspace enums of the connector state
in the drm_atomic_helper_connector_hdmi_check().
Before hastily sending the patch, I consulted maintainers in the #dri-devel
channel and Javier pointed out that the attachment of the colorspace should
not be done in the glue code of the Rockchip driver since it merely uses the
DRM bridge framework. Furthermore he said the modeset force should not be done
drm_atomic_helper_connector_hdmi_check(), since it was meant to only check
conn_state->hdmi, which the colorspace doesn't belong to. He suggested to
rather implement them in the drm_bridge_connector_atomic_check() and
drm_bridge_connector_init() respectively. This is what patch does.
This is my first patch to the upstream kernel, so I am sending it as RFC.
I found the solution with the assistance of AI tools, but I do have a basic
understanding of the kernel's driver model and API. While I made sure to
carefully read the rules on how to do this correctly, I probably still
haven't done everything right. I am happy to make further changes if necessary.
If this is however done correctly, it should probably supersede the patch
mentioned above.
Best regards,
Jan
2.56.0
reply other threads:[~2026-10-11 13:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261011132024.2833-1-jan.claussen10@web.de \
--to=jan.claussen10@web.de \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®