* [PATCH v4 1/7] drm/connector: Fix typo in colorspace error messages
2026-10-18 14:31 [PATCH v4 0/7] drm: Add colorspace property support to the HDMI helpers Jan Claußen
@ 2026-10-18 14:31 ` Jan Claußen
2026-10-18 14:31 ` [PATCH v4 2/7] drm/display: hdmi-state-helper: Force modeset on colorspace change Jan Claußen
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Jan Claußen @ 2026-10-18 14:31 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter
Cc: Jan Claußen, dri-devel, linux-kernel
Change provded to provided.
Signed-off-by: Jan Claußen <jan.claussen10@web.de>
---
drivers/gpu/drm/drm_connector.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 893716a9e489..66f53e155342 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -2768,14 +2768,14 @@ static int drm_mode_create_colorspace_property(struct drm_connector *connector,
return 0;
if (!supported_colorspaces) {
- drm_err(dev, "No supported colorspaces provded on [CONNECTOR:%d:%s]\n",
- connector->base.id, connector->name);
+ drm_err(dev, "No supported colorspaces provided on [CONNECTOR:%d:%s]\n",
+ connector->base.id, connector->name);
return -EINVAL;
}
if ((supported_colorspaces & -BIT(DRM_MODE_COLORIMETRY_COUNT)) != 0) {
- drm_err(dev, "Unknown colorspace provded on [CONNECTOR:%d:%s]\n",
- connector->base.id, connector->name);
+ drm_err(dev, "Unknown colorspace provided on [CONNECTOR:%d:%s]\n",
+ connector->base.id, connector->name);
return -EINVAL;
}
--
2.56.0
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v4 2/7] drm/display: hdmi-state-helper: Force modeset on colorspace change
2026-10-18 14:31 [PATCH v4 0/7] drm: Add colorspace property support to the HDMI helpers Jan Claußen
2026-10-18 14:31 ` [PATCH v4 1/7] drm/connector: Fix typo in colorspace error messages Jan Claußen
@ 2026-10-18 14:31 ` Jan Claußen
2026-10-18 14:31 ` [PATCH v4 3/7] drm/connector: hdmi: Create the colorspace property Jan Claußen
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Jan Claußen @ 2026-10-18 14:31 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Dmitry Baryshkov, Daniel Stone,
Nicolas Frattaroli, Cristian Ciocaltea, Jan Claußen
Cc: John Harrison, dri-devel, linux-kernel
The colorimetry signalled to the sink is part of the AVI infoframe,
which is only updated on a modeset. A change of the colorspace
property therefore never reaches the sink.
Treat a colorspace change like a change of the Broadcast RGB, output
bpc or output format, and force a modeset.
Signed-off-by: Jan Claußen <jan.claussen10@web.de>
---
drivers/gpu/drm/display/drm_hdmi_state_helper.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
index 7cdb7ca3dc12..9368e53c5945 100644
--- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
@@ -925,7 +925,8 @@ int drm_atomic_helper_connector_hdmi_check(struct drm_connector *connector,
if (old_conn_state->hdmi.broadcast_rgb != new_conn_state->hdmi.broadcast_rgb ||
old_conn_state->hdmi.output_bpc != new_conn_state->hdmi.output_bpc ||
- old_conn_state->hdmi.output_format != new_conn_state->hdmi.output_format) {
+ old_conn_state->hdmi.output_format != new_conn_state->hdmi.output_format ||
+ old_conn_state->colorspace != new_conn_state->colorspace) {
struct drm_crtc *crtc = new_conn_state->crtc;
struct drm_crtc_state *crtc_state;
--
2.56.0
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v4 3/7] drm/connector: hdmi: Create the colorspace property
2026-10-18 14:31 [PATCH v4 0/7] drm: Add colorspace property support to the HDMI helpers Jan Claußen
2026-10-18 14:31 ` [PATCH v4 1/7] drm/connector: Fix typo in colorspace error messages Jan Claußen
2026-10-18 14:31 ` [PATCH v4 2/7] drm/display: hdmi-state-helper: Force modeset on colorspace change Jan Claußen
@ 2026-10-18 14:31 ` Jan Claußen
2026-10-18 14:31 ` [PATCH v4 4/7] drm/bridge-connector: Pass supported colorspaces to the HDMI helpers Jan Claußen
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Jan Claußen @ 2026-10-18 14:31 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter
Cc: Jan Claußen, dri-devel, linux-kernel
HDMI connectors initialised through drmm_connector_hdmi_init() do not
expose the colorspace property, so userspace cannot signal colorimetry
such as BT.2020 for HDR output. KWin, for instance, does not offer HDR
without it.
Add a supported_colorspaces bitmask to struct drm_connector_hdmi_funcs.
If a driver sets it, create and attach the colorspace property with
the colorspaces it lists, next to the other HDMI properties.
Signed-off-by: Jan Claußen <jan.claussen10@web.de>
---
drivers/gpu/drm/drm_connector.c | 9 +++++++++
include/drm/drm_connector.h | 7 +++++++
2 files changed, 16 insertions(+)
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 66f53e155342..eea27bb6557c 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -672,6 +672,15 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
/* TODO: remove after conversion to new drmm_connector_hdmi_init() */
connector->max_bpc = hdmi_funcs->max_bpc;
+ if (hdmi_funcs->supported_colorspaces) {
+ ret = drm_mode_create_hdmi_colorspace_property(connector,
+ hdmi_funcs->supported_colorspaces);
+ if (ret)
+ return ret;
+
+ drm_connector_attach_colorspace_property(connector);
+ }
+
if (hdmi_funcs->max_bpc > 8)
drm_connector_attach_hdr_output_metadata_property(connector);
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 2ee7c59329aa..9d2d133463ba 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1521,6 +1521,13 @@ struct drm_connector_hdmi_funcs {
*/
unsigned long supported_formats;
+ /**
+ * @supported_colorspaces:
+ *
+ * Bitmask of &enum drm_colorspace listing supported color spaces.
+ */
+ unsigned long supported_colorspaces;
+
/**
* @max_bpc: Maximum bits per char the HDMI connector supports.
*/
--
2.56.0
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v4 4/7] drm/bridge-connector: Pass supported colorspaces to the HDMI helpers
2026-10-18 14:31 [PATCH v4 0/7] drm: Add colorspace property support to the HDMI helpers Jan Claußen
` (2 preceding siblings ...)
2026-10-18 14:31 ` [PATCH v4 3/7] drm/connector: hdmi: Create the colorspace property Jan Claußen
@ 2026-10-18 14:31 ` Jan Claußen
2026-10-18 14:31 ` [PATCH v4 5/7] drm/bridge: dw-hdmi-qp: Forward supported colorspaces from platform data Jan Claußen
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Jan Claußen @ 2026-10-18 14:31 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
Cc: Jan Claußen, Javier Martinez Canillas, dri-devel, linux-kernel
Add a supported_colorspaces field to struct drm_bridge so HDMI bridges
can declare the colorimetries they support, and pass it on to
drmm_connector_hdmi_init() so the colorspace property gets created.
Suggested-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Jan Claußen <jan.claussen10@web.de>
---
drivers/gpu/drm/display/drm_bridge_connector.c | 4 ++++
include/drm/drm_bridge.h | 7 +++++++
2 files changed, 11 insertions(+)
diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index 81f3e26f6fdf..40f50304c46f 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -1042,6 +1042,10 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
bridge_connector->hdmi_funcs.supported_formats =
bridge_connector->bridge_hdmi->supported_formats;
+ if (bridge_connector->bridge_hdmi->supported_colorspaces)
+ bridge_connector->hdmi_funcs.supported_colorspaces =
+ bridge_connector->bridge_hdmi->supported_colorspaces;
+
if (!connector->ycbcr_420_allowed)
bridge_connector->hdmi_funcs.supported_formats &=
~BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
index 1981d24a700d..b46d34040024 100644
--- a/include/drm/drm_bridge.h
+++ b/include/drm/drm_bridge.h
@@ -1129,6 +1129,13 @@ struct drm_bridge {
*/
unsigned int supported_formats;
+ /**
+ * @supported_colorspaces: Bitmask of &enum drm_colorspace listing
+ * supported color spaces. This is only relevant if @DRM_BRIDGE_OP_HDMI
+ * is set.
+ */
+ unsigned int supported_colorspaces;
+
/**
* @max_tmds_char_rate: Maximum TMDS character rate, in Hz, the HDMI
* bridge supports. A value of 0 means the core should use the default
--
2.56.0
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v4 5/7] drm/bridge: dw-hdmi-qp: Forward supported colorspaces from platform data
2026-10-18 14:31 [PATCH v4 0/7] drm: Add colorspace property support to the HDMI helpers Jan Claußen
` (3 preceding siblings ...)
2026-10-18 14:31 ` [PATCH v4 4/7] drm/bridge-connector: Pass supported colorspaces to the HDMI helpers Jan Claußen
@ 2026-10-18 14:31 ` Jan Claußen
2026-10-18 14:31 ` [PATCH v4 6/7] drm/rockchip: dw_hdmi_qp: Set the VOP2 color space from the connector Jan Claußen
2026-10-18 14:31 ` [PATCH v4 7/7] drm/rockchip: dw_hdmi_qp: Advertise BT.709 and BT.2020 colorimetries Jan Claußen
6 siblings, 0 replies; 8+ messages in thread
From: Jan Claußen @ 2026-10-18 14:31 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
Cc: Jan Claußen, dri-devel, linux-rockchip, linux-kernel
Let platform glue drivers declare the supported colorspaces, the same
way they already declare supported output formats and max bpc.
Signed-off-by: Jan Claußen <jan.claussen10@web.de>
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 3 +++
include/drm/bridge/dw_hdmi_qp.h | 2 ++
2 files changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
index c9568aea98dc..6017c44b03d4 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
@@ -1129,6 +1129,9 @@ struct dw_hdmi_qp *dw_hdmi_qp_bind(struct platform_device *pdev,
if (plat_data->supported_formats)
hdmi->bridge.supported_formats = plat_data->supported_formats;
+ if (plat_data->supported_colorspaces)
+ hdmi->bridge.supported_colorspaces = plat_data->supported_colorspaces;
+
if (plat_data->max_bpc)
hdmi->bridge.max_bpc = plat_data->max_bpc;
diff --git a/include/drm/bridge/dw_hdmi_qp.h b/include/drm/bridge/dw_hdmi_qp.h
index 6ea9c561cfef..a15af81989cc 100644
--- a/include/drm/bridge/dw_hdmi_qp.h
+++ b/include/drm/bridge/dw_hdmi_qp.h
@@ -27,6 +27,8 @@ struct dw_hdmi_qp_plat_data {
unsigned long ref_clk_rate;
/* Supported output formats: bitmask of @drm_output_color_format */
unsigned int supported_formats;
+ /* Supported colorspaces: bitmask of &enum drm_colorspace */
+ unsigned int supported_colorspaces;
/* Maximum bits per color channel: 8, 10 or 12 */
unsigned int max_bpc;
};
--
2.56.0
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v4 6/7] drm/rockchip: dw_hdmi_qp: Set the VOP2 color space from the connector
2026-10-18 14:31 [PATCH v4 0/7] drm: Add colorspace property support to the HDMI helpers Jan Claußen
` (4 preceding siblings ...)
2026-10-18 14:31 ` [PATCH v4 5/7] drm/bridge: dw-hdmi-qp: Forward supported colorspaces from platform data Jan Claußen
@ 2026-10-18 14:31 ` Jan Claußen
2026-10-18 14:31 ` [PATCH v4 7/7] drm/rockchip: dw_hdmi_qp: Advertise BT.709 and BT.2020 colorimetries Jan Claußen
6 siblings, 0 replies; 8+ messages in thread
From: Jan Claußen @ 2026-10-18 14:31 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
VOP2 converts RGB to YCbCr using the matrix selected by the CRTC
state's color_space, but the HDMI encoder never sets it, so VOP2
always converts with BT.709. Once the colorspace property can
signal BT.2020 colorimetry to the sink, a YCbCr output would be
encoded with BT.709 and decoded with BT.2020.
Derive color_space from the connector colorspace before the early
return, so that a colorspace change alone is applied.
Signed-off-by: Jan Claußen <jan.claussen10@web.de>
---
drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 16 ++++++++++++++++
1 file changed, 16 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..10c5b6d6406e 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
@@ -17,6 +17,7 @@
#include <linux/phy/phy.h>
#include <linux/phy/phy-hdmi.h>
#include <linux/regmap.h>
+#include <linux/videodev2.h>
#include <linux/workqueue.h>
#include <drm/bridge/dw_hdmi_qp.h>
@@ -187,6 +188,19 @@ static int dw_hdmi_qp_rockchip_get_vop_format(struct drm_encoder *encoder,
return bstate->output_bus_cfg.format;
}
+static u32
+dw_hdmi_qp_rockchip_color_space(const struct drm_connector_state *conn_state)
+{
+ switch (conn_state->colorspace) {
+ case DRM_MODE_COLORIMETRY_BT2020_RGB:
+ case DRM_MODE_COLORIMETRY_BT2020_YCC:
+ case DRM_MODE_COLORIMETRY_BT2020_CYCC:
+ return V4L2_COLORSPACE_BT2020;
+ default:
+ return V4L2_COLORSPACE_DEFAULT;
+ }
+}
+
static int
dw_hdmi_qp_rockchip_encoder_atomic_check(struct drm_encoder *encoder,
struct drm_crtc_state *crtc_state,
@@ -202,6 +216,8 @@ dw_hdmi_qp_rockchip_encoder_atomic_check(struct drm_encoder *encoder,
if (ingest_fmt < 0)
return -EINVAL;
+ s->color_space = dw_hdmi_qp_rockchip_color_space(conn_state);
+
if (hdmi->tmds_char_rate == conn_state->hdmi.tmds_char_rate &&
s->output_bpc == conn_state->hdmi.output_bpc &&
s->bus_format == ingest_fmt)
--
2.56.0
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v4 7/7] drm/rockchip: dw_hdmi_qp: Advertise BT.709 and BT.2020 colorimetries
2026-10-18 14:31 [PATCH v4 0/7] drm: Add colorspace property support to the HDMI helpers Jan Claußen
` (5 preceding siblings ...)
2026-10-18 14:31 ` [PATCH v4 6/7] drm/rockchip: dw_hdmi_qp: Set the VOP2 color space from the connector Jan Claußen
@ 2026-10-18 14:31 ` Jan Claußen
6 siblings, 0 replies; 8+ messages in thread
From: Jan Claußen @ 2026-10-18 14:31 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>
---
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 10c5b6d6406e..e677aacf5a33 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
@@ -621,6 +621,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 [flat|nested] 8+ messages in thread