Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/6] drm: Add colorspace property support to the HDMI helpers
@ 2026-10-18 12:30 Jan Claußen
  2026-10-18 12:30 ` [PATCH v3 6/6] drm/rockchip: dw_hdmi_qp: Advertise BT.709 and BT.2020 colorimetries Jan Claußen
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Claußen @ 2026-10-18 12:30 UTC (permalink / raw)
  To: Sandy Huang, Heiko Stübner, Andy Yan, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Dmitry Baryshkov,
	Daniel Stone, Cristian Ciocaltea, Nicolas Frattaroli,
	Jan Claußen
  Cc: dri-devel, linux-rockchip, linux-kernel, linux-arm-kernel

HDMI connectors set up through drmm_connector_hdmi_init() don't expose
the colorspace property, so userspace can't signal BT.2020 colorimetry
for HDR. KWin, for example, doesn't offer HDR without it.

This series lets drivers declare which colorspaces they support and has
the HDMI helpers create the property and force a modeset when it
changes. dw-hdmi-qp on RK3588 is the first user.

Tested on a Radxa Rock 5B (RK3588) with an LG OLED55B87LC in KDE
Plasma 6.7.5. Only BT.2020 RGB is tested.

Does VOP2 use matching coefficients for BT.709/BT.2020 YCC
output?

Changes in v3:
- Move colorspace handling into the HDMI helpers (Maxime)
- Let drivers declare supported colorspaces instead of exposing all
- Split into a series

Changes in v2:
- Fix possible null pointer dereferencing requested by the Sashiko bot

v2: https://lore.kernel.org/all/20261011142733.7806-1-jan.claussen10@web.de
v1: https://lore.kernel.org/all/20261011132024.2833-1-jan.claussen10@web.de

Jan Claußen (6):
  drm/connector: Fix typo in colorspace error messages
  drm/display: hdmi-state-helper: Force modeset on colorspace change
  drm/connector: hdmi: Create the colorspace property
  drm/bridge-connector: Pass supported colorspaces to the HDMI helpers
  drm/bridge: dw-hdmi-qp: Forward supported colorspaces from platform
    data
  drm/rockchip: dw_hdmi_qp: Advertise BT.709 and BT.2020 colorimetries

 drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c    |  3 +++
 drivers/gpu/drm/display/drm_bridge_connector.c  |  4 ++++
 drivers/gpu/drm/display/drm_hdmi_state_helper.c |  3 ++-
 drivers/gpu/drm/drm_connector.c                 | 17 +++++++++++++----
 drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c  |  4 ++++
 include/drm/bridge/dw_hdmi_qp.h                 |  2 ++
 include/drm/drm_bridge.h                        |  7 +++++++
 include/drm/drm_connector.h                     |  7 +++++++
 8 files changed, 42 insertions(+), 5 deletions(-)

-- 
2.56.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 6/6] drm/rockchip: dw_hdmi_qp: Advertise BT.709 and BT.2020 colorimetries
  2026-10-18 12:30 [PATCH v3 0/6] drm: Add colorspace property support to the HDMI helpers Jan Claußen
@ 2026-10-18 12:30 ` Jan Claußen
  2026-10-19  3:19   ` Chaoyi Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Claußen @ 2026-10-18 12:30 UTC (permalink / raw)
  To: Sandy Huang, Heiko Stübner, Andy Yan, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: Jan Claußen, dri-devel, linux-rockchip, linux-arm-kernel,
	linux-kernel

Expose BT.2020 RGB and YCC colorimetry so userspace can enable HDR
output. Also explicitly expose BT.709 YCC as it is listed in the
Rockchip RK3588 TRM V1.0-Part2 20220309 data sheet.

Tested on a Radxa Rock 5B (RK3588) with an LG OLED55B87LC in KDE
Plasma 6.7.5: enabling HDR switches the colorspace to BT.2020, and
disabling it restores the default.

Signed-off-by: Jan Claußen <jan.claussen10@web.de>
---

Not sure if BT.709 needs to be explicitly exposed here, but it is mentioned in the data sheet.
Might be covered by DRM_MODE_COLORIMETRY_DEFAULT though.

BT.709/BT.2020 YCC are untested.

 drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
index 9c4cf68d79d5..dbb87dfd000c 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
@@ -605,6 +605,10 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
 				      BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444) |
 				      BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
 
+	plat_data.supported_colorspaces = BIT(DRM_MODE_COLORIMETRY_BT709_YCC) |
+				      BIT(DRM_MODE_COLORIMETRY_BT2020_RGB) |
+				      BIT(DRM_MODE_COLORIMETRY_BT2020_YCC);
+
 	encoder = &hdmi->encoder.encoder;
 	encoder->possible_crtcs = drm_of_find_possible_crtcs(drm, dev->of_node);
 
-- 
2.56.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 6/6] drm/rockchip: dw_hdmi_qp: Advertise BT.709 and BT.2020 colorimetries
  2026-10-18 12:30 ` [PATCH v3 6/6] drm/rockchip: dw_hdmi_qp: Advertise BT.709 and BT.2020 colorimetries Jan Claußen
@ 2026-10-19  3:19   ` Chaoyi Chen
  2026-10-19 10:40     ` Cristian Ciocaltea
  0 siblings, 1 reply; 4+ messages in thread
From: Chaoyi Chen @ 2026-10-19  3:19 UTC (permalink / raw)
  To: Jan Claußen, Sandy Huang, Heiko Stübner, Andy Yan,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter
  Cc: Cristian Ciocaltea, dri-devel, linux-rockchip, linux-arm-kernel,
	linux-kernel

Hi Jan,

On 10/18/2026 8:30 PM, Jan Claußen wrote:
> Expose BT.2020 RGB and YCC colorimetry so userspace can enable HDR
> output. Also explicitly expose BT.709 YCC as it is listed in the
> Rockchip RK3588 TRM V1.0-Part2 20220309 data sheet.
> 
> Tested on a Radxa Rock 5B (RK3588) with an LG OLED55B87LC in KDE
> Plasma 6.7.5: enabling HDR switches the colorspace to BT.2020, and
> disabling it restores the default.
> 
> Signed-off-by: Jan Claußen <jan.claussen10@web.de>
> ---
> 
> Not sure if BT.709 needs to be explicitly exposed here, but it is mentioned in the data sheet.
> Might be covered by DRM_MODE_COLORIMETRY_DEFAULT though.

Cc: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>

Hi Cristian, may be you would be interested in this series?

"DEFAULT" may refer to either BT.601 or BT.709. It should support the
following color spaces:

#define HDMI_COLORSPACE_CAPS_V1		(DRM_MODE_COLORIMETRY_DEFAULT | \
					DRM_MODE_COLORIMETRY_SMPTE_170M_YCC | \
					DRM_MODE_COLORIMETRY_BT709_YCC | \
					DRM_MODE_COLORIMETRY_BT2020_RGB)

#define HDMI_COLORSPACE_CAPS_V2		(HDMI_COLORSPACE_CAPS_V1 | \
					DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65)

> 
> BT.709/BT.2020 YCC are untested.
> 
>  drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
> index 9c4cf68d79d5..dbb87dfd000c 100644
> --- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
> @@ -605,6 +605,10 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
>  				      BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444) |
>  				      BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
>  
> +	plat_data.supported_colorspaces = BIT(DRM_MODE_COLORIMETRY_BT709_YCC) |
> +				      BIT(DRM_MODE_COLORIMETRY_BT2020_RGB) |
> +				      BIT(DRM_MODE_COLORIMETRY_BT2020_YCC);
> +
>  	encoder = &hdmi->encoder.encoder;
>  	encoder->possible_crtcs = drm_of_find_possible_crtcs(drm, dev->of_node);
>  

-- 
Best, 
Chaoyi


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 6/6] drm/rockchip: dw_hdmi_qp: Advertise BT.709 and BT.2020 colorimetries
  2026-10-19  3:19   ` Chaoyi Chen
@ 2026-10-19 10:40     ` Cristian Ciocaltea
  0 siblings, 0 replies; 4+ messages in thread
From: Cristian Ciocaltea @ 2026-10-19 10:40 UTC (permalink / raw)
  To: Chaoyi Chen, Jan Claußen, Sandy Huang, Heiko Stübner,
	Andy Yan, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter
  Cc: dri-devel, linux-rockchip, linux-arm-kernel, linux-kernel

On 10/19/26 6:19 AM, Chaoyi Chen wrote:
> Hi Jan,
> 
> On 10/18/2026 8:30 PM, Jan Claußen wrote:
>> Expose BT.2020 RGB and YCC colorimetry so userspace can enable HDR
>> output. Also explicitly expose BT.709 YCC as it is listed in the
>> Rockchip RK3588 TRM V1.0-Part2 20220309 data sheet.
>>
>> Tested on a Radxa Rock 5B (RK3588) with an LG OLED55B87LC in KDE
>> Plasma 6.7.5: enabling HDR switches the colorspace to BT.2020, and
>> disabling it restores the default.
>>
>> Signed-off-by: Jan Claußen <jan.claussen10@web.de>
>> ---
>>
>> Not sure if BT.709 needs to be explicitly exposed here, but it is mentioned in the data sheet.
>> Might be covered by DRM_MODE_COLORIMETRY_DEFAULT though.
> 
> Cc: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> 
> Hi Cristian, may be you would be interested in this series?

Hi Chaoyi, I already planned to check this out soon. Please note there's a newer
revision of the series, so I think it's best to move further discussions there.

Regards,
Cristian


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-19 10:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-18 12:30 [PATCH v3 0/6] drm: Add colorspace property support to the HDMI helpers Jan Claußen
2026-10-18 12:30 ` [PATCH v3 6/6] drm/rockchip: dw_hdmi_qp: Advertise BT.709 and BT.2020 colorimetries Jan Claußen
2026-10-19  3:19   ` Chaoyi Chen
2026-10-19 10:40     ` Cristian Ciocaltea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox