mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maxime Ripard <mripard@kernel.org>
To: "Jan Claußen" <jan.claussen10@web.de>
Cc: 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>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	 David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	 Javier Martinez Canillas <javierm@redhat.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC v2] drm/bridge: connector: Support the colorspace property for HDMI
Date: Tue, 13 Oct 2026 10:40:08 +0200	[thread overview]
Message-ID: <as3t4OTbGHIOuXlG@houat> (raw)
In-Reply-To: <20261011142733.7806-1-jan.claussen10@web.de>

[-- Attachment #1: Type: text/plain, Size: 2976 bytes --]

On Sun, Oct 11, 2026 at 02:27:32PM +0000, Jan Claußen wrote:
> 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 KDE 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    | 25 ++++++++++++++++---
>  1 file changed, 22 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
> index 81f3e26f6fdf..885094cc6ddf 100644
> --- a/drivers/gpu/drm/display/drm_bridge_connector.c
> +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
> @@ -414,11 +414,24 @@ static int drm_bridge_connector_atomic_check(struct drm_connector *connector,
>  {
>  	struct drm_bridge_connector *bridge_connector =
>  		to_drm_bridge_connector(connector);
> +	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 (bridge_connector->bridge_hdmi)
> -		return drm_atomic_helper_connector_hdmi_check(connector, state);
> +	if (!bridge_connector->bridge_hdmi)
> +		return 0;
>  
> -	return 0;
> +	if (new_state->crtc && 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;
> +	}
> +
> +	return drm_atomic_helper_connector_hdmi_check(connector, state);
>  }
>  
>  static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = {
> @@ -1079,6 +1092,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);

This should come from drivers, you can't expect every driver to support
every HDMI colorspace.

> +		if (ret)
> +			return ERR_PTR(ret);
> +
> +		drm_connector_attach_colorspace_property(connector);

Most importantly, all that work should be in the HDMI helpers, it's an
HDMI feature just like, say, max bpc

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

      reply	other threads:[~2026-10-13  8:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 14:27 Jan Claußen
2026-10-13  8:40 ` Maxime Ripard [this message]

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=as3t4OTbGHIOuXlG@houat \
    --to=mripard@kernel.org \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jan.claussen10@web.de \
    --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=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®