public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/14] drm: Create drm_output_color_format enum
@ 2026-02-24 10:58 Maxime Ripard
  2026-02-24 10:58 ` [PATCH 01/14] drm/connector: Introduce " Maxime Ripard
                   ` (14 more replies)
  0 siblings, 15 replies; 28+ messages in thread
From: Maxime Ripard @ 2026-02-24 10:58 UTC (permalink / raw)
  To: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

Hi,

This series creates an enum to represent the output color format as an
enum instead of a bitmask, and consolidate the HDMI helpers to use the
new enum.

This should make Nicolas' work easier.

It has been build tested, and passes kunit tests.

Let me know what you think,
Maxime

---
Maxime Ripard (14):
      drm/connector: Introduce drm_output_color_format enum
      drm/edid: Convert to drm_output_color_format enum
      drm/display: hdmi: Convert to drm_output_color_format
      drm/amdgpu: display: Convert to drm_output_color_format
      drm/bridge: adv7511: Convert to drm_output_color_format
      drm/bridge: analogix: Convert to drm_output_color_format
      drm/bridge: cadence: Convert to drm_output_color_format
      drm/bridge: synopsys: dw-dp: Convert to drm_output_color_format
      drm/bridge: synopsys: dw-hdmi: Convert to drm_output_color_format
      drm/arm: komeda: Convert to drm_output_color_format
      drm/mediatek: dp: Convert to drm_output_color_format
      drm/rockchip: analogix: Convert to drm_output_color_format
      drm/connector: Remove DRM_COLOR_FORMAT defines
      drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace

 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |   4 +-
 .../gpu/drm/arm/display/komeda/d71/d71_component.c |  14 +-
 drivers/gpu/drm/arm/display/komeda/komeda_crtc.c   |   2 +-
 .../gpu/drm/arm/display/komeda/komeda_pipeline.h   |   5 +-
 .../drm/arm/display/komeda/komeda_pipeline_state.c |   2 +-
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c       |   2 +-
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c |   4 +-
 .../gpu/drm/bridge/cadence/cdns-mhdp8546-core.c    |  24 +--
 .../gpu/drm/bridge/cadence/cdns-mhdp8546-core.h    |   2 +-
 drivers/gpu/drm/bridge/inno-hdmi.c                 |   6 +-
 drivers/gpu/drm/bridge/ite-it6263.c                |   2 +-
 drivers/gpu/drm/bridge/synopsys/dw-dp.c            |  71 ++++----
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c          |  16 +-
 drivers/gpu/drm/display/drm_hdmi_helper.c          |   7 +-
 drivers/gpu/drm/display/drm_hdmi_state_helper.c    |  60 ++++---
 drivers/gpu/drm/drm_bridge.c                       |   2 +-
 drivers/gpu/drm/drm_connector.c                    |  14 +-
 drivers/gpu/drm/drm_edid.c                         |  18 +-
 drivers/gpu/drm/mediatek/mtk_dp.c                  |   4 +-
 drivers/gpu/drm/mediatek/mtk_hdmi_v2.c             |   8 +-
 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c    |   4 +-
 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c             |   2 +-
 drivers/gpu/drm/tests/drm_connector_test.c         |  80 ++++-----
 drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 182 ++++++++++-----------
 drivers/gpu/drm/vc4/vc4_hdmi.c                     |  18 +-
 drivers/gpu/drm/vc4/vc4_hdmi.h                     |   2 +-
 include/drm/display/drm_hdmi_helper.h              |   3 +-
 include/drm/drm_connector.h                        |  46 ++++--
 28 files changed, 326 insertions(+), 278 deletions(-)
---
base-commit: 3a2ffb469faa8240fe87e7d5f3533d14fdcc69f3
change-id: 20260224-drm-rework-color-formats-82dcccc13c11

Best regards,
-- 
Maxime Ripard <mripard@kernel.org>


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

* [PATCH 01/14] drm/connector: Introduce drm_output_color_format enum
  2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
@ 2026-02-24 10:58 ` Maxime Ripard
  2026-02-26  9:12   ` Philipp Zabel
  2026-02-24 10:58 ` [PATCH 02/14] drm/edid: Convert to " Maxime Ripard
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 28+ messages in thread
From: Maxime Ripard @ 2026-02-24 10:58 UTC (permalink / raw)
  To: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

The EDID parsing code initially introduced the DRM_COLOR_FORMAT_*
defines to represent the sink capabilities. Since a given sink could
support multiple formats, it was first defined as a bitmask.

However, the core and drivers have since leveraged those defines to
represent both the supported formats but also the current format being
used.

Considering the latter case, the more natural, and consistent, thing to
do would be to create an enum of all the possible formats, and then list
the supported formats using a bitmask of the individual enum values.

Let's create a new enum following that pattern, drm_output_color_format,
while maintaining the DRM_COLOR_FORMAT_* compatibility to make the
transition easier.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 include/drm/drm_connector.h | 42 ++++++++++++++++++++++++++++++++++--------
 1 file changed, 34 insertions(+), 8 deletions(-)

diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 7eaec37ae1c735334afa7dad15a38cf0c8b761b8..c67539708f636ae3905bb8424c63799bd1811f28 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -554,10 +554,35 @@ enum drm_colorspace {
 	DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT	= 14,
 	DRM_MODE_COLORIMETRY_BT601_YCC		= 15,
 	DRM_MODE_COLORIMETRY_COUNT
 };
 
+/**
+ * enum drm_output_color_format - Output Color Format
+ *
+ * This enum is a consolidated color format list supported by
+ * connectors. It's only ever really been used for HDMI and DP so far,
+ * so it's not exhaustive and can be extended to represent other formats
+ * in the future.
+ *
+ *
+ * @DRM_OUTPUT_COLOR_FORMAT_RGB444:
+ *   RGB output format
+ * @DRM_OUTPUT_COLOR_FORMAT_YCBCR444:
+ *   YCbCr 4:4:4 output format (ie. not subsampled)
+ * @DRM_OUTPUT_COLOR_FORMAT_YCBCR422:
+ *   YCbCr 4:2:2 output format (ie. with horizontal subsampling)
+ * @DRM_OUTPUT_COLOR_FORMAT_YCBCR420:
+ *   YCbCr 4:2:0 output format (ie. with horizontal and vertical subsampling)
+ */
+enum drm_output_color_format {
+	DRM_OUTPUT_COLOR_FORMAT_RGB444 = 0,
+	DRM_OUTPUT_COLOR_FORMAT_YCBCR444,
+	DRM_OUTPUT_COLOR_FORMAT_YCBCR422,
+	DRM_OUTPUT_COLOR_FORMAT_YCBCR420,
+};
+
 /**
  * enum drm_bus_flags - bus_flags info for &drm_display_info
  *
  * This enum defines signal polarities and clock edge information for signals on
  * a bus as bitmask flags.
@@ -697,14 +722,14 @@ struct drm_display_info {
 	/**
 	 * @subpixel_order: Subpixel order of LCD panels.
 	 */
 	enum subpixel_order subpixel_order;
 
-#define DRM_COLOR_FORMAT_RGB444		(1<<0)
-#define DRM_COLOR_FORMAT_YCBCR444	(1<<1)
-#define DRM_COLOR_FORMAT_YCBCR422	(1<<2)
-#define DRM_COLOR_FORMAT_YCBCR420	(1<<3)
+#define DRM_COLOR_FORMAT_RGB444		(1 << DRM_OUTPUT_COLOR_FORMAT_RGB444)
+#define DRM_COLOR_FORMAT_YCBCR444	(1 << DRM_OUTPUT_COLOR_FORMAT_YCBCR444)
+#define DRM_COLOR_FORMAT_YCBCR422	(1 << DRM_OUTPUT_COLOR_FORMAT_YCBCR422)
+#define DRM_COLOR_FORMAT_YCBCR420	(1 << DRM_OUTPUT_COLOR_FORMAT_YCBCR420)
 
 	/**
 	 * @panel_orientation: Read only connector property for built-in panels,
 	 * indicating the orientation of the panel vs the device's casing.
 	 * drm_connector_init() sets this to DRM_MODE_PANEL_ORIENTATION_UNKNOWN.
@@ -712,14 +737,15 @@ struct drm_display_info {
 	 * fb to compensate and gets exported as prop to userspace.
 	 */
 	int panel_orientation;
 
 	/**
-	 * @color_formats: HDMI Color formats, selects between RGB and YCrCb
-	 * modes. Used DRM_COLOR_FORMAT\_ defines, which are _not_ the same ones
-	 * as used to describe the pixel format in framebuffers, and also don't
-	 * match the formats in @bus_formats which are shared with v4l.
+	 * @color_formats: HDMI Color formats, selects between RGB and
+	 * YCrCb modes. Uses a bitmask of DRM_OUTPUT_COLOR_FORMAT\_
+	 * defines, which are _not_ the same ones as used to describe
+	 * the pixel format in framebuffers, and also don't match the
+	 * formats in @bus_formats which are shared with v4l.
 	 */
 	u32 color_formats;
 
 	/**
 	 * @bus_formats: Pixel data format on the wire, somewhat redundant with

-- 
2.52.0


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

* [PATCH 02/14] drm/edid: Convert to drm_output_color_format enum
  2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
  2026-02-24 10:58 ` [PATCH 01/14] drm/connector: Introduce " Maxime Ripard
@ 2026-02-24 10:58 ` Maxime Ripard
  2026-02-24 10:58 ` [PATCH 03/14] drm/display: hdmi: Convert to drm_output_color_format Maxime Ripard
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2026-02-24 10:58 UTC (permalink / raw)
  To: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

Now that we introduced a new drm_output_color_format enum to represent
what DRM_COLOR_FORMAT_* bits were representing, we can switch to the new
enum.

The main different is that while DRM_COLOR_FORMAT_ was a bitmask,
drm_output_color_format is a proper enum. However, the enum was done is
such a way than DRM_COLOR_FORMAT_X = BIT(DRM_OUTPUT_COLOR_FORMAT_X) so
the transitition is easier.

The only thing we need to consider is if the original code meant to use
that value as a bitmask, in which case we do need to keep the bit shift,
or as a discriminant in which case we don't.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/gpu/drm/drm_edid.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 26bb7710a46204548c150a25d390dac512ec7f0e..316bbdcdbbd3a9bb447e1a4127be9da039e306b5 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -5314,11 +5314,11 @@ static void parse_cta_y420cmdb(struct drm_connector *connector,
 	for (i = 0; i < map_len; i++)
 		map |= (u64)data[i] << (8 * i);
 
 out:
 	if (map)
-		info->color_formats |= DRM_COLOR_FORMAT_YCBCR420;
+		info->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
 
 	*y420cmdb_map = map;
 }
 
 static int add_cea_modes(struct drm_connector *connector,
@@ -6090,11 +6090,11 @@ static void parse_cta_y420vdb(struct drm_connector *connector,
 
 		if (!drm_valid_cea_vic(vic))
 			continue;
 
 		bitmap_set(hdmi->y420_vdb_modes, vic, 1);
-		info->color_formats |= DRM_COLOR_FORMAT_YCBCR420;
+		info->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
 	}
 }
 
 static void drm_parse_vcdb(struct drm_connector *connector, const u8 *db)
 {
@@ -6424,15 +6424,15 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
 				    "[CONNECTOR:%d:%s] CEA extension version mismatch %u != %u\n",
 				    connector->base.id, connector->name,
 				    info->cea_rev, edid_ext[1]);
 
 		/* The existence of a CTA extension should imply RGB support */
-		info->color_formats = DRM_COLOR_FORMAT_RGB444;
+		info->color_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444);
 		if (edid_ext[3] & EDID_CEA_YCRCB444)
-			info->color_formats |= DRM_COLOR_FORMAT_YCBCR444;
+			info->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444);
 		if (edid_ext[3] & EDID_CEA_YCRCB422)
-			info->color_formats |= DRM_COLOR_FORMAT_YCBCR422;
+			info->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
 		if (edid_ext[3] & EDID_BASIC_AUDIO)
 			info->has_audio = true;
 
 	}
 	drm_edid_iter_end(&edid_iter);
@@ -6696,11 +6696,11 @@ static void update_display_info(struct drm_connector *connector,
 		goto out;
 
 	if (!drm_edid_is_digital(drm_edid))
 		goto out;
 
-	info->color_formats |= DRM_COLOR_FORMAT_RGB444;
+	info->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	drm_parse_cea_ext(connector, drm_edid);
 
 	update_displayid_info(connector, drm_edid);
 
 	/*
@@ -6750,13 +6750,13 @@ static void update_display_info(struct drm_connector *connector,
 	drm_dbg_kms(connector->dev,
 		    "[CONNECTOR:%d:%s] Assigning EDID-1.4 digital sink color depth as %d bpc.\n",
 		    connector->base.id, connector->name, info->bpc);
 
 	if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444)
-		info->color_formats |= DRM_COLOR_FORMAT_YCBCR444;
+		info->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444);
 	if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422)
-		info->color_formats |= DRM_COLOR_FORMAT_YCBCR422;
+		info->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
 
 	drm_update_mso(connector, drm_edid);
 
 out:
 	if (drm_edid_has_internal_quirk(connector, EDID_QUIRK_NON_DESKTOP)) {
@@ -7227,11 +7227,11 @@ static bool is_hdmi2_sink(const struct drm_connector *connector)
 	 */
 	if (!connector)
 		return true;
 
 	return connector->display_info.hdmi.scdc.supported ||
-		connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420;
+		connector->display_info.color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
 }
 
 static u8 drm_mode_hdmi_vic(const struct drm_connector *connector,
 			    const struct drm_display_mode *mode)
 {

-- 
2.52.0


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

* [PATCH 03/14] drm/display: hdmi: Convert to drm_output_color_format
  2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
  2026-02-24 10:58 ` [PATCH 01/14] drm/connector: Introduce " Maxime Ripard
  2026-02-24 10:58 ` [PATCH 02/14] drm/edid: Convert to " Maxime Ripard
@ 2026-02-24 10:58 ` Maxime Ripard
  2026-02-24 10:58 ` [PATCH 04/14] drm/amdgpu: display: " Maxime Ripard
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2026-02-24 10:58 UTC (permalink / raw)
  To: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

Now that we introduced a new drm_output_color_format enum to represent
what DRM_COLOR_FORMAT_* bits were representing, we can switch to the new
enum.

The main different is that while DRM_COLOR_FORMAT_ was a bitmask,
drm_output_color_format is a proper enum. However, the enum was done is
such a way than DRM_COLOR_FORMAT_X = BIT(DRM_OUTPUT_COLOR_FORMAT_X) so
the transitition is easier.

The only thing we need to consider is if the original code meant to use
that value as a bitmask, in which case we do need to keep the bit shift,
or as a discriminant in which case we don't.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/gpu/drm/display/drm_hdmi_state_helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
index a1d16762ac7a9ebdc48f081c5d2f5e200d406099..f2aec6f65e7a374cea9a1e3adafb4f1cc4d6ab9a 100644
--- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
@@ -426,11 +426,11 @@ sink_supports_format_bpc(const struct drm_connector *connector,
 		 * color_formats field will be blank and not report any
 		 * format supported. In such a case, assume that RGB is
 		 * supported so we can keep things going and light up
 		 * the display.
 		 */
-		if (!(info->color_formats & DRM_COLOR_FORMAT_RGB444))
+		if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444)))
 			drm_warn(dev, "HDMI Sink doesn't support RGB, something's wrong.\n");
 
 		if (bpc == 10 && !(info->edid_hdmi_rgb444_dc_modes & DRM_EDID_HDMI_DC_30)) {
 			drm_dbg_kms(dev, "10 BPC but sink doesn't support Deep Color 30.\n");
 			return false;
@@ -446,11 +446,11 @@ sink_supports_format_bpc(const struct drm_connector *connector,
 		return true;
 
 	case HDMI_COLORSPACE_YUV420:
 		drm_dbg_kms(dev, "YUV420 format, checking the constraints.\n");
 
-		if (!(info->color_formats & DRM_COLOR_FORMAT_YCBCR420)) {
+		if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420))) {
 			drm_dbg_kms(dev, "Sink doesn't support YUV420.\n");
 			return false;
 		}
 
 		if (!drm_mode_is_420(info, mode)) {
@@ -478,11 +478,11 @@ sink_supports_format_bpc(const struct drm_connector *connector,
 		return true;
 
 	case HDMI_COLORSPACE_YUV422:
 		drm_dbg_kms(dev, "YUV422 format, checking the constraints.\n");
 
-		if (!(info->color_formats & DRM_COLOR_FORMAT_YCBCR422)) {
+		if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422))) {
 			drm_dbg_kms(dev, "Sink doesn't support YUV422.\n");
 			return false;
 		}
 
 		if (bpc > 12) {
@@ -501,11 +501,11 @@ sink_supports_format_bpc(const struct drm_connector *connector,
 		return true;
 
 	case HDMI_COLORSPACE_YUV444:
 		drm_dbg_kms(dev, "YUV444 format, checking the constraints.\n");
 
-		if (!(info->color_formats & DRM_COLOR_FORMAT_YCBCR444)) {
+		if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444))) {
 			drm_dbg_kms(dev, "Sink doesn't support YUV444.\n");
 			return false;
 		}
 
 		if (bpc == 10 && !(info->edid_hdmi_ycbcr444_dc_modes & DRM_EDID_HDMI_DC_30)) {

-- 
2.52.0


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

* [PATCH 04/14] drm/amdgpu: display: Convert to drm_output_color_format
  2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
                   ` (2 preceding siblings ...)
  2026-02-24 10:58 ` [PATCH 03/14] drm/display: hdmi: Convert to drm_output_color_format Maxime Ripard
@ 2026-02-24 10:58 ` Maxime Ripard
  2026-02-24 10:58 ` [PATCH 05/14] drm/bridge: adv7511: " Maxime Ripard
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2026-02-24 10:58 UTC (permalink / raw)
  To: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

Now that we introduced a new drm_output_color_format enum to represent
what DRM_COLOR_FORMAT_* bits were representing, we can switch to the new
enum.

The main different is that while DRM_COLOR_FORMAT_ was a bitmask,
drm_output_color_format is a proper enum. However, the enum was done is
such a way than DRM_COLOR_FORMAT_X = BIT(DRM_OUTPUT_COLOR_FORMAT_X) so
the transitition is easier.

The only thing we need to consider is if the original code meant to use
that value as a bitmask, in which case we do need to keep the bit shift,
or as a discriminant in which case we don't.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++--
 1 file changed, 2 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 c3c045c8144f104ce498d8be3664438b6b799588..76348fb027dfee26c3fceaedf7d37fc29d91e7f5 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -6717,15 +6717,15 @@ static void fill_stream_properties_from_drm_display_mode(
 		timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR420;
 	else if (drm_mode_is_420_also(info, mode_in)
 			&& aconnector
 			&& aconnector->force_yuv420_output)
 		timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR420;
-	else if ((connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR422)
+	else if ((connector->display_info.color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422))
 			&& aconnector
 			&& aconnector->force_yuv422_output)
 		timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR422;
-	else if ((connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR444)
+	else if ((connector->display_info.color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444))
 			&& stream->signal == SIGNAL_TYPE_HDMI_TYPE_A)
 		timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR444;
 	else
 		timing_out->pixel_encoding = PIXEL_ENCODING_RGB;
 

-- 
2.52.0


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

* [PATCH 05/14] drm/bridge: adv7511: Convert to drm_output_color_format
  2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
                   ` (3 preceding siblings ...)
  2026-02-24 10:58 ` [PATCH 04/14] drm/amdgpu: display: " Maxime Ripard
@ 2026-02-24 10:58 ` Maxime Ripard
  2026-02-24 10:58 ` [PATCH 06/14] drm/bridge: analogix: " Maxime Ripard
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2026-02-24 10:58 UTC (permalink / raw)
  To: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

Now that we introduced a new drm_output_color_format enum to represent
what DRM_COLOR_FORMAT_* bits were representing, we can switch to the new
enum.

The main different is that while DRM_COLOR_FORMAT_ was a bitmask,
drm_output_color_format is a proper enum. However, the enum was done is
such a way than DRM_COLOR_FORMAT_X = BIT(DRM_OUTPUT_COLOR_FORMAT_X) so
the transitition is easier.

The only thing we need to consider is if the original code meant to use
that value as a bitmask, in which case we do need to keep the bit shift,
or as a discriminant in which case we don't.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index 1050bb62280bb4794f0b0ae01597269652c063d0..6bd76c1fb0071c8c9cd9c293b3a48a2b4487768e 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -226,11 +226,11 @@ static void adv7511_set_config_csc(struct adv7511 *adv7511,
 	} else {
 		config.csc_scaling_factor = ADV7511_CSC_SCALING_4;
 		config.csc_coefficents = adv7511_csc_ycbcr_to_rgb;
 
 		if ((connector->display_info.color_formats &
-		     DRM_COLOR_FORMAT_YCBCR422) &&
+		     BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422)) &&
 		    connector->display_info.is_hdmi) {
 			config.csc_enable = false;
 			output_format_422 = true;
 			output_format_ycbcr = true;
 		} else {

-- 
2.52.0


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

* [PATCH 06/14] drm/bridge: analogix: Convert to drm_output_color_format
  2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
                   ` (4 preceding siblings ...)
  2026-02-24 10:58 ` [PATCH 05/14] drm/bridge: adv7511: " Maxime Ripard
@ 2026-02-24 10:58 ` Maxime Ripard
  2026-02-24 10:58 ` [PATCH 07/14] drm/bridge: cadence: " Maxime Ripard
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2026-02-24 10:58 UTC (permalink / raw)
  To: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

Now that we introduced a new drm_output_color_format enum to represent
what DRM_COLOR_FORMAT_* bits were representing, we can switch to the new
enum.

The main different is that while DRM_COLOR_FORMAT_ was a bitmask,
drm_output_color_format is a proper enum. However, the enum was done is
such a way than DRM_COLOR_FORMAT_X = BIT(DRM_OUTPUT_COLOR_FORMAT_X) so
the transitition is easier.

The only thing we need to consider is if the original code meant to use
that value as a bitmask, in which case we do need to keep the bit shift,
or as a discriminant in which case we don't.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index efe534977d12de3383390fb3040bbfa4a99064cc..71e3d2426ab013218ff1bdda70e299a7e5229eec 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1341,13 +1341,13 @@ static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge,
 		break;
 	default:
 		video->color_depth = COLOR_8;
 		break;
 	}
-	if (display_info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
+	if (display_info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444))
 		video->color_space = COLOR_YCBCR444;
-	else if (display_info->color_formats & DRM_COLOR_FORMAT_YCBCR422)
+	else if (display_info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422))
 		video->color_space = COLOR_YCBCR422;
 	else
 		video->color_space = COLOR_RGB;
 
 	/*

-- 
2.52.0


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

* [PATCH 07/14] drm/bridge: cadence: Convert to drm_output_color_format
  2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
                   ` (5 preceding siblings ...)
  2026-02-24 10:58 ` [PATCH 06/14] drm/bridge: analogix: " Maxime Ripard
@ 2026-02-24 10:58 ` Maxime Ripard
  2026-02-24 10:58 ` [PATCH 08/14] drm/bridge: synopsys: dw-dp: " Maxime Ripard
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2026-02-24 10:58 UTC (permalink / raw)
  To: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

Now that we introduced a new drm_output_color_format enum to represent
what DRM_COLOR_FORMAT_* bits were representing, we can switch to the new
enum.

The main different is that while DRM_COLOR_FORMAT_ was a bitmask,
drm_output_color_format is a proper enum. However, the enum was done is
such a way than DRM_COLOR_FORMAT_X = BIT(DRM_OUTPUT_COLOR_FORMAT_X) so
the transitition is easier.

The only thing we need to consider is if the original code meant to use
that value as a bitmask, in which case we do need to keep the bit shift,
or as a discriminant in which case we don't.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 .../gpu/drm/bridge/cadence/cdns-mhdp8546-core.c    | 24 +++++++++++-----------
 .../gpu/drm/bridge/cadence/cdns-mhdp8546-core.h    |  2 +-
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
index 38726ae1bf1504528bcd9e3e11670c658a067423..5c2165b310677cb671e57447eb854af614f849ec 100644
--- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
+++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
@@ -1500,18 +1500,18 @@ static u32 cdns_mhdp_get_bpp(struct cdns_mhdp_display_fmt *fmt)
 
 	if (fmt->y_only)
 		return fmt->bpc;
 
 	switch (fmt->color_format) {
-	case DRM_COLOR_FORMAT_RGB444:
-	case DRM_COLOR_FORMAT_YCBCR444:
+	case DRM_OUTPUT_COLOR_FORMAT_RGB444:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR444:
 		bpp = fmt->bpc * 3;
 		break;
-	case DRM_COLOR_FORMAT_YCBCR422:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR422:
 		bpp = fmt->bpc * 2;
 		break;
-	case DRM_COLOR_FORMAT_YCBCR420:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR420:
 		bpp = fmt->bpc * 3 / 2;
 		break;
 	default:
 		bpp = fmt->bpc * 3;
 		WARN_ON(1);
@@ -1710,30 +1710,30 @@ static void cdns_mhdp_configure_video(struct cdns_mhdp_device *mhdp,
 
 	/*
 	 * If YCBCR supported and stream not SD, use ITU709
 	 * Need to handle ITU version with YCBCR420 when supported
 	 */
-	if ((pxlfmt == DRM_COLOR_FORMAT_YCBCR444 ||
-	     pxlfmt == DRM_COLOR_FORMAT_YCBCR422) && mode->crtc_vdisplay >= 720)
+	if ((pxlfmt == DRM_OUTPUT_COLOR_FORMAT_YCBCR444 ||
+	     pxlfmt == DRM_OUTPUT_COLOR_FORMAT_YCBCR422) && mode->crtc_vdisplay >= 720)
 		misc0 = DP_YCBCR_COEFFICIENTS_ITU709;
 
 	bpp = cdns_mhdp_get_bpp(&mhdp->display_fmt);
 
 	switch (pxlfmt) {
-	case DRM_COLOR_FORMAT_RGB444:
+	case DRM_OUTPUT_COLOR_FORMAT_RGB444:
 		pxl_repr = CDNS_DP_FRAMER_RGB << CDNS_DP_FRAMER_PXL_FORMAT;
 		misc0 |= DP_COLOR_FORMAT_RGB;
 		break;
-	case DRM_COLOR_FORMAT_YCBCR444:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR444:
 		pxl_repr = CDNS_DP_FRAMER_YCBCR444 << CDNS_DP_FRAMER_PXL_FORMAT;
 		misc0 |= DP_COLOR_FORMAT_YCbCr444 | DP_TEST_DYNAMIC_RANGE_CEA;
 		break;
-	case DRM_COLOR_FORMAT_YCBCR422:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR422:
 		pxl_repr = CDNS_DP_FRAMER_YCBCR422 << CDNS_DP_FRAMER_PXL_FORMAT;
 		misc0 |= DP_COLOR_FORMAT_YCbCr422 | DP_TEST_DYNAMIC_RANGE_CEA;
 		break;
-	case DRM_COLOR_FORMAT_YCBCR420:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR420:
 		pxl_repr = CDNS_DP_FRAMER_YCBCR420 << CDNS_DP_FRAMER_PXL_FORMAT;
 		break;
 	default:
 		pxl_repr = CDNS_DP_FRAMER_Y_ONLY << CDNS_DP_FRAMER_PXL_FORMAT;
 	}
@@ -1825,11 +1825,11 @@ static void cdns_mhdp_configure_video(struct cdns_mhdp_device *mhdp,
 	    mode->crtc_vtotal % 2 == 0)
 		misc1 = DP_TEST_INTERLACED;
 	if (mhdp->display_fmt.y_only)
 		misc1 |= CDNS_DP_TEST_COLOR_FORMAT_RAW_Y_ONLY;
 	/* Use VSC SDP for Y420 */
-	if (pxlfmt == DRM_COLOR_FORMAT_YCBCR420)
+	if (pxlfmt == DRM_OUTPUT_COLOR_FORMAT_YCBCR420)
 		misc1 = CDNS_DP_TEST_VSC_SDP;
 
 	cdns_mhdp_reg_write(mhdp, CDNS_DP_MSA_MISC(stream_id),
 			    misc0 | (misc1 << 8));
 
@@ -2479,11 +2479,11 @@ static int cdns_mhdp_probe(struct platform_device *pdev)
 	mhdp->link.rate = mhdp->host.link_rate;
 	mhdp->link.num_lanes = mhdp->host.lanes_cnt;
 
 	/* The only currently supported format */
 	mhdp->display_fmt.y_only = false;
-	mhdp->display_fmt.color_format = DRM_COLOR_FORMAT_RGB444;
+	mhdp->display_fmt.color_format = DRM_OUTPUT_COLOR_FORMAT_RGB444;
 	mhdp->display_fmt.bpc = 8;
 
 	mhdp->bridge.of_node = pdev->dev.of_node;
 	mhdp->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID |
 			   DRM_BRIDGE_OP_HPD;
diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.h b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.h
index bad2fc0c7306607a98b84730233c0e984c90576f..8e99a813db0f25eb92f0aa6675e1807c992750a6 100644
--- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.h
+++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.h
@@ -304,11 +304,11 @@ struct cdns_mhdp_sink {
 	bool enhanced;
 	bool ssc;
 };
 
 struct cdns_mhdp_display_fmt {
-	u32 color_format;
+	enum drm_output_color_format color_format;
 	u32 bpc;
 	bool y_only;
 };
 
 /*

-- 
2.52.0


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

* [PATCH 08/14] drm/bridge: synopsys: dw-dp: Convert to drm_output_color_format
  2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
                   ` (6 preceding siblings ...)
  2026-02-24 10:58 ` [PATCH 07/14] drm/bridge: cadence: " Maxime Ripard
@ 2026-02-24 10:58 ` Maxime Ripard
  2026-02-24 10:58 ` [PATCH 09/14] drm/bridge: synopsys: dw-hdmi: " Maxime Ripard
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2026-02-24 10:58 UTC (permalink / raw)
  To: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

Now that we introduced a new drm_output_color_format enum to represent
what DRM_COLOR_FORMAT_* bits were representing, we can switch to the new
enum.

The main different is that while DRM_COLOR_FORMAT_ was a bitmask,
drm_output_color_format is a proper enum. However, the enum was done is
such a way than DRM_COLOR_FORMAT_X = BIT(DRM_OUTPUT_COLOR_FORMAT_X) so
the transitition is easier.

The only thing we need to consider is if the original code meant to use
that value as a bitmask, in which case we do need to keep the bit shift,
or as a discriminant in which case we don't.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/gpu/drm/bridge/synopsys/dw-dp.c | 71 +++++++++++++++++----------------
 1 file changed, 36 insertions(+), 35 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
index 43234245248473805f0a36c5b251212bb31bfb17..e9c03c69781d2070fd0ffde2e4eaafa726e4f758 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
@@ -383,28 +383,28 @@ enum {
 	DW_DP_PHY_PATTERN_CP2520_2,
 };
 
 struct dw_dp_output_format {
 	u32 bus_format;
-	u32 color_format;
+	enum drm_output_color_format color_format;
 	u8 video_mapping;
 	u8 bpc;
 	u8 bpp;
 };
 
 #define to_dw_dp_bridge_state(s) container_of(s, struct dw_dp_bridge_state, base)
 
 static const struct dw_dp_output_format dw_dp_output_formats[] = {
-	{ MEDIA_BUS_FMT_RGB101010_1X30, DRM_COLOR_FORMAT_RGB444, DW_DP_RGB_10BIT, 10, 30 },
-	{ MEDIA_BUS_FMT_RGB888_1X24, DRM_COLOR_FORMAT_RGB444, DW_DP_RGB_8BIT, 8, 24 },
-	{ MEDIA_BUS_FMT_YUV10_1X30, DRM_COLOR_FORMAT_YCBCR444, DW_DP_YCBCR444_10BIT, 10, 30 },
-	{ MEDIA_BUS_FMT_YUV8_1X24, DRM_COLOR_FORMAT_YCBCR444, DW_DP_YCBCR444_8BIT, 8, 24},
-	{ MEDIA_BUS_FMT_YUYV10_1X20, DRM_COLOR_FORMAT_YCBCR422, DW_DP_YCBCR422_10BIT, 10, 20 },
-	{ MEDIA_BUS_FMT_YUYV8_1X16, DRM_COLOR_FORMAT_YCBCR422, DW_DP_YCBCR422_8BIT, 8, 16 },
-	{ MEDIA_BUS_FMT_UYYVYY10_0_5X30, DRM_COLOR_FORMAT_YCBCR420, DW_DP_YCBCR420_10BIT, 10, 15 },
-	{ MEDIA_BUS_FMT_UYYVYY8_0_5X24, DRM_COLOR_FORMAT_YCBCR420, DW_DP_YCBCR420_8BIT, 8, 12 },
-	{ MEDIA_BUS_FMT_RGB666_1X24_CPADHI, DRM_COLOR_FORMAT_RGB444, DW_DP_RGB_6BIT, 6, 18 },
+	{ MEDIA_BUS_FMT_RGB101010_1X30, DRM_OUTPUT_COLOR_FORMAT_RGB444, DW_DP_RGB_10BIT, 10, 30 },
+	{ MEDIA_BUS_FMT_RGB888_1X24, DRM_OUTPUT_COLOR_FORMAT_RGB444, DW_DP_RGB_8BIT, 8, 24 },
+	{ MEDIA_BUS_FMT_YUV10_1X30, DRM_OUTPUT_COLOR_FORMAT_YCBCR444, DW_DP_YCBCR444_10BIT, 10, 30 },
+	{ MEDIA_BUS_FMT_YUV8_1X24, DRM_OUTPUT_COLOR_FORMAT_YCBCR444, DW_DP_YCBCR444_8BIT, 8, 24},
+	{ MEDIA_BUS_FMT_YUYV10_1X20, DRM_OUTPUT_COLOR_FORMAT_YCBCR422, DW_DP_YCBCR422_10BIT, 10, 20 },
+	{ MEDIA_BUS_FMT_YUYV8_1X16, DRM_OUTPUT_COLOR_FORMAT_YCBCR422, DW_DP_YCBCR422_8BIT, 8, 16 },
+	{ MEDIA_BUS_FMT_UYYVYY10_0_5X30, DRM_OUTPUT_COLOR_FORMAT_YCBCR420, DW_DP_YCBCR420_10BIT, 10, 15 },
+	{ MEDIA_BUS_FMT_UYYVYY8_0_5X24, DRM_OUTPUT_COLOR_FORMAT_YCBCR420, DW_DP_YCBCR420_8BIT, 8, 12 },
+	{ MEDIA_BUS_FMT_RGB666_1X24_CPADHI, DRM_OUTPUT_COLOR_FORMAT_RGB444, DW_DP_RGB_6BIT, 6, 18 },
 };
 
 static const struct dw_dp_output_format *dw_dp_get_output_format(u32 bus_format)
 {
 	unsigned int i;
@@ -1095,26 +1095,26 @@ static int dw_dp_send_vsc_sdp(struct dw_dp *dp)
 	vsc.content_type = DP_CONTENT_TYPE_NOT_DEFINED;
 
 	sdp.flags = DW_DP_SDP_VERTICAL_INTERVAL;
 
 	switch (state->color_format) {
-	case DRM_COLOR_FORMAT_YCBCR444:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR444:
 		vsc.pixelformat = DP_PIXELFORMAT_YUV444;
 		break;
-	case DRM_COLOR_FORMAT_YCBCR420:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR420:
 		vsc.pixelformat = DP_PIXELFORMAT_YUV420;
 		break;
-	case DRM_COLOR_FORMAT_YCBCR422:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR422:
 		vsc.pixelformat = DP_PIXELFORMAT_YUV422;
 		break;
-	case DRM_COLOR_FORMAT_RGB444:
+	case DRM_OUTPUT_COLOR_FORMAT_RGB444:
 	default:
 		vsc.pixelformat = DP_PIXELFORMAT_RGB;
 		break;
 	}
 
-	if (state->color_format == DRM_COLOR_FORMAT_RGB444) {
+	if (state->color_format == DRM_OUTPUT_COLOR_FORMAT_RGB444) {
 		vsc.colorimetry = DP_COLORIMETRY_DEFAULT;
 		vsc.dynamic_range = DP_DYNAMIC_RANGE_VESA;
 	} else {
 		vsc.colorimetry = DP_COLORIMETRY_BT709_YCC;
 		vsc.dynamic_range = DP_DYNAMIC_RANGE_CTA;
@@ -1152,35 +1152,36 @@ static bool dw_dp_video_need_vsc_sdp(struct dw_dp *dp)
 		return -EINVAL;
 
 	if (!link->vsc_sdp_supported)
 		return false;
 
-	if (state->color_format == DRM_COLOR_FORMAT_YCBCR420)
+	if (state->color_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR420)
 		return true;
 
 	return false;
 }
 
-static int dw_dp_video_set_msa(struct dw_dp *dp, u8 color_format, u8 bpc,
-			       u16 vstart, u16 hstart)
+static int dw_dp_video_set_msa(struct dw_dp *dp,
+			       enum drm_output_color_format color_format,
+			       u8 bpc, u16 vstart, u16 hstart)
 {
 	u16 misc = 0;
 
 	if (dw_dp_video_need_vsc_sdp(dp))
 		misc |= DP_MSA_MISC_COLOR_VSC_SDP;
 
 	switch (color_format) {
-	case DRM_COLOR_FORMAT_RGB444:
+	case DRM_OUTPUT_COLOR_FORMAT_RGB444:
 		misc |= DP_MSA_MISC_COLOR_RGB;
 		break;
-	case DRM_COLOR_FORMAT_YCBCR444:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR444:
 		misc |= DP_MSA_MISC_COLOR_YCBCR_444_BT709;
 		break;
-	case DRM_COLOR_FORMAT_YCBCR422:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR422:
 		misc |= DP_MSA_MISC_COLOR_YCBCR_422_BT709;
 		break;
-	case DRM_COLOR_FORMAT_YCBCR420:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR420:
 		break;
 	default:
 		return -EINVAL;
 	}
 
@@ -1308,13 +1309,13 @@ static int dw_dp_video_enable(struct dw_dp *dp)
 	average_bytes_per_tu = ts / 1000;
 	average_bytes_per_tu_frac = ts / 100 - average_bytes_per_tu * 10;
 	if (dp->pixel_mode == DW_DP_MP_SINGLE_PIXEL) {
 		if (average_bytes_per_tu < 6)
 			init_threshold = 32;
-		else if (hblank <= 80 && color_format != DRM_COLOR_FORMAT_YCBCR420)
+		else if (hblank <= 80 && color_format != DRM_OUTPUT_COLOR_FORMAT_YCBCR420)
 			init_threshold = 12;
-		else if (hblank <= 40 && color_format == DRM_COLOR_FORMAT_YCBCR420)
+		else if (hblank <= 40 && color_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR420)
 			init_threshold = 3;
 		else
 			init_threshold = 16;
 	} else {
 		u32 t1 = 0, t2 = 0, t3 = 0;
@@ -1322,47 +1323,47 @@ static int dw_dp_video_enable(struct dw_dp *dp)
 		switch (bpc) {
 		case 6:
 			t1 = (4 * 1000 / 9) * link->lanes;
 			break;
 		case 8:
-			if (color_format == DRM_COLOR_FORMAT_YCBCR422) {
+			if (color_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR422) {
 				t1 = (1000 / 2) * link->lanes;
 			} else {
 				if (dp->pixel_mode == DW_DP_MP_DUAL_PIXEL)
 					t1 = (1000 / 3) * link->lanes;
 				else
 					t1 = (3000 / 16) * link->lanes;
 			}
 			break;
 		case 10:
-			if (color_format == DRM_COLOR_FORMAT_YCBCR422)
+			if (color_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR422)
 				t1 = (2000 / 5) * link->lanes;
 			else
 				t1 = (4000 / 15) * link->lanes;
 			break;
 		case 12:
-			if (color_format == DRM_COLOR_FORMAT_YCBCR422) {
+			if (color_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR422) {
 				if (dp->pixel_mode == DW_DP_MP_DUAL_PIXEL)
 					t1 = (1000 / 6) * link->lanes;
 				else
 					t1 = (1000 / 3) * link->lanes;
 			} else {
 				t1 = (2000 / 9) * link->lanes;
 			}
 			break;
 		case 16:
-			if (color_format != DRM_COLOR_FORMAT_YCBCR422 &&
+			if (color_format != DRM_OUTPUT_COLOR_FORMAT_YCBCR422 &&
 			    dp->pixel_mode == DW_DP_MP_DUAL_PIXEL)
 				t1 = (1000 / 6) * link->lanes;
 			else
 				t1 = (1000 / 4) * link->lanes;
 			break;
 		default:
 			return -EINVAL;
 		}
 
-		if (color_format == DRM_COLOR_FORMAT_YCBCR420)
+		if (color_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR420)
 			t2 = (link->rate / 4) * 1000 / (mode->clock / 2);
 		else
 			t2 = (link->rate / 4) * 1000 / mode->clock;
 
 		if (average_bytes_per_tu_frac)
@@ -1578,17 +1579,17 @@ static enum drm_mode_status dw_dp_bridge_mode_valid(struct drm_bridge *bridge,
 {
 	struct dw_dp *dp = bridge_to_dp(bridge);
 	struct dw_dp_link *link = &dp->link;
 	u32 min_bpp;
 
-	if (info->color_formats & DRM_COLOR_FORMAT_YCBCR420 &&
+	if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420) &&
 	    link->vsc_sdp_supported &&
 	    (drm_mode_is_420_only(info, mode) || drm_mode_is_420_also(info, mode)))
 		min_bpp = 12;
-	else if (info->color_formats & DRM_COLOR_FORMAT_YCBCR422)
+	else if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422))
 		min_bpp = 16;
-	else if (info->color_formats & DRM_COLOR_FORMAT_RGB444)
+	else if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444))
 		min_bpp = 18;
 	else
 		min_bpp = 24;
 
 	if (!link->vsc_sdp_supported &&
@@ -1781,18 +1782,18 @@ static u32 *dw_dp_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
 		fmt = &dw_dp_output_formats[i];
 
 		if (fmt->bpc > conn_state->max_bpc)
 			continue;
 
-		if (!(fmt->color_format & di->color_formats))
+		if (!(BIT(fmt->color_format) & di->color_formats))
 			continue;
 
-		if (fmt->color_format == DRM_COLOR_FORMAT_YCBCR420 &&
+		if (fmt->color_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR420 &&
 		    !link->vsc_sdp_supported)
 			continue;
 
-		if (fmt->color_format != DRM_COLOR_FORMAT_YCBCR420 &&
+		if (fmt->color_format != DRM_OUTPUT_COLOR_FORMAT_YCBCR420 &&
 		    drm_mode_is_420_only(di, &mode))
 			continue;
 
 		if (!dw_dp_bandwidth_ok(dp, &mode, fmt->bpp, link->lanes, link->rate))
 			continue;

-- 
2.52.0


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

* [PATCH 09/14] drm/bridge: synopsys: dw-hdmi: Convert to drm_output_color_format
  2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
                   ` (7 preceding siblings ...)
  2026-02-24 10:58 ` [PATCH 08/14] drm/bridge: synopsys: dw-dp: " Maxime Ripard
@ 2026-02-24 10:58 ` Maxime Ripard
  2026-02-26  8:59   ` Philipp Zabel
  2026-02-24 10:58 ` [PATCH 10/14] drm/arm: komeda: " Maxime Ripard
                   ` (5 subsequent siblings)
  14 siblings, 1 reply; 28+ messages in thread
From: Maxime Ripard @ 2026-02-24 10:58 UTC (permalink / raw)
  To: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

Now that we introduced a new drm_output_color_format enum to represent
what DRM_COLOR_FORMAT_* bits were representing, we can switch to the new
enum.

The main different is that while DRM_COLOR_FORMAT_ was a bitmask,
drm_output_color_format is a proper enum. However, the enum was done is
such a way than DRM_COLOR_FORMAT_X = BIT(DRM_OUTPUT_COLOR_FORMAT_X) so
the transitition is easier.

The only thing we need to consider is if the original code meant to use
that value as a bitmask, in which case we do need to keep the bit shift,
or as a discriminant in which case we don't.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index ee88c0e793b0416d20105a43448cb4037402e64b..0296e110ce65ffc284e120f4e3f92052474e83e5 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -2662,11 +2662,11 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
 	struct drm_connector *conn = conn_state->connector;
 	struct drm_display_info *info = &conn->display_info;
 	struct drm_display_mode *mode = &crtc_state->mode;
 	u8 max_bpc = conn_state->max_requested_bpc;
 	bool is_hdmi2_sink = info->hdmi.scdc.supported ||
-			     (info->color_formats & DRM_COLOR_FORMAT_YCBCR420);
+			     (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420));
 	u32 *output_fmts;
 	unsigned int i = 0;
 
 	*num_output_fmts = 0;
 
@@ -2721,40 +2721,40 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
 
 	/* Default 8bit RGB fallback */
 	output_fmts[i++] = MEDIA_BUS_FMT_RGB888_1X24;
 
 	if (max_bpc >= 16 && info->bpc == 16) {
-		if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
+		if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444))
 			output_fmts[i++] = MEDIA_BUS_FMT_YUV16_1X48;
 
 		output_fmts[i++] = MEDIA_BUS_FMT_RGB161616_1X48;
 	}
 
 	if (max_bpc >= 12 && info->bpc >= 12) {
-		if (info->color_formats & DRM_COLOR_FORMAT_YCBCR422)
+		if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422))
 			output_fmts[i++] = MEDIA_BUS_FMT_UYVY12_1X24;
 
-		if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
+		if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444))
 			output_fmts[i++] = MEDIA_BUS_FMT_YUV12_1X36;
 
 		output_fmts[i++] = MEDIA_BUS_FMT_RGB121212_1X36;
 	}
 
 	if (max_bpc >= 10 && info->bpc >= 10) {
-		if (info->color_formats & DRM_COLOR_FORMAT_YCBCR422)
+		if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422))
 			output_fmts[i++] = MEDIA_BUS_FMT_UYVY10_1X20;
 
-		if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
+		if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444))
 			output_fmts[i++] = MEDIA_BUS_FMT_YUV10_1X30;
 
 		output_fmts[i++] = MEDIA_BUS_FMT_RGB101010_1X30;
 	}
 
-	if (info->color_formats & DRM_COLOR_FORMAT_YCBCR422)
+	if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422))
 		output_fmts[i++] = MEDIA_BUS_FMT_UYVY8_1X16;
 
-	if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
+	if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444))
 		output_fmts[i++] = MEDIA_BUS_FMT_YUV8_1X24;
 
 	*num_output_fmts = i;
 
 	return output_fmts;

-- 
2.52.0


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

* [PATCH 10/14] drm/arm: komeda: Convert to drm_output_color_format
  2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
                   ` (8 preceding siblings ...)
  2026-02-24 10:58 ` [PATCH 09/14] drm/bridge: synopsys: dw-hdmi: " Maxime Ripard
@ 2026-02-24 10:58 ` Maxime Ripard
  2026-02-25 16:12   ` Liviu Dudau
  2026-02-24 10:58 ` [PATCH 11/14] drm/mediatek: dp: " Maxime Ripard
                   ` (4 subsequent siblings)
  14 siblings, 1 reply; 28+ messages in thread
From: Maxime Ripard @ 2026-02-24 10:58 UTC (permalink / raw)
  To: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

Now that we introduced a new drm_output_color_format enum to represent
what DRM_COLOR_FORMAT_* bits were representing, we can switch to the new
enum.

The main different is that while DRM_COLOR_FORMAT_ was a bitmask,
drm_output_color_format is a proper enum. However, the enum was done is
such a way than DRM_COLOR_FORMAT_X = BIT(DRM_OUTPUT_COLOR_FORMAT_X) so
the transitition is easier.

The only thing we need to consider is if the original code meant to use
that value as a bitmask, in which case we do need to keep the bit shift,
or as a discriminant in which case we don't.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/gpu/drm/arm/display/komeda/d71/d71_component.c     | 14 +++++++-------
 drivers/gpu/drm/arm/display/komeda/komeda_crtc.c           |  2 +-
 drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h       |  5 +++--
 drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c |  2 +-
 4 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c
index 67e5d3b4190f62549bc8da700deb4b15e138b515..27ca2930cdac6e76a058102ea2c1d8306d85e751 100644
--- a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c
+++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c
@@ -1078,15 +1078,15 @@ static void d71_improc_update(struct komeda_component *c,
 	}
 
 	mask |= IPS_CTRL_YUV | IPS_CTRL_CHD422 | IPS_CTRL_CHD420;
 
 	/* config color format */
-	if (st->color_format == DRM_COLOR_FORMAT_YCBCR420)
+	if (st->color_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR420)
 		ctrl |= IPS_CTRL_YUV | IPS_CTRL_CHD422 | IPS_CTRL_CHD420;
-	else if (st->color_format == DRM_COLOR_FORMAT_YCBCR422)
+	else if (st->color_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR422)
 		ctrl |= IPS_CTRL_YUV | IPS_CTRL_CHD422;
-	else if (st->color_format == DRM_COLOR_FORMAT_YCBCR444)
+	else if (st->color_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR444)
 		ctrl |= IPS_CTRL_YUV;
 
 	malidp_write32_mask(reg, BLK_CONTROL, mask, ctrl);
 }
 
@@ -1143,16 +1143,16 @@ static int d71_improc_init(struct d71_dev *d71,
 		return PTR_ERR(c);
 	}
 
 	improc = to_improc(c);
 	improc->supported_color_depths = BIT(8) | BIT(10);
-	improc->supported_color_formats = DRM_COLOR_FORMAT_RGB444 |
-					  DRM_COLOR_FORMAT_YCBCR444 |
-					  DRM_COLOR_FORMAT_YCBCR422;
+	improc->supported_color_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) |
+					  BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444) |
+					  BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
 	value = malidp_read32(reg, BLK_INFO);
 	if (value & IPS_INFO_CHD420)
-		improc->supported_color_formats |= DRM_COLOR_FORMAT_YCBCR420;
+		improc->supported_color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
 
 	improc->supports_csc = true;
 	improc->supports_gamma = true;
 
 	return 0;
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
index 5a66948ffd24343cfc144e9b500679fd0c6bf43b..e78604469ef74800a4cac1e854821578b7e7bce8 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
@@ -38,11 +38,11 @@ void komeda_crtc_get_color_config(struct drm_crtc_state *crtc_st,
 			min_bpc = conn_bpc;
 	}
 
 	/* connector doesn't config any color_format, use RGB444 as default */
 	if (!conn_color_formats)
-		conn_color_formats = DRM_COLOR_FORMAT_RGB444;
+		conn_color_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444);
 
 	*color_depths = GENMASK(min_bpc, 0);
 	*color_formats = conn_color_formats;
 }
 
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
index ac8725e248537e5737d16cd36860401c42073500..dbe93894b2f6a193e24963d497ebb7b717ce3ebb 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
@@ -315,20 +315,21 @@ struct komeda_splitter_state {
 	u16 overlap;
 };
 
 struct komeda_improc {
 	struct komeda_component base;
-	u32 supported_color_formats;  /* DRM_RGB/YUV444/YUV420*/
+	u32 supported_color_formats;  /* BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444/YUV444/YUV420) */
 	u32 supported_color_depths; /* BIT(8) | BIT(10)*/
 	u8 supports_degamma : 1;
 	u8 supports_csc : 1;
 	u8 supports_gamma : 1;
 };
 
 struct komeda_improc_state {
 	struct komeda_component_state base;
-	u8 color_format, color_depth;
+	enum drm_output_color_format color_format;
+	u8 color_depth;
 	u16 hsize, vsize;
 	u32 fgamma_coeffs[KOMEDA_N_GAMMA_COEFFS];
 	u32 ctm_coeffs[KOMEDA_N_CTM_COEFFS];
 };
 
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
index f4e76b46ca327a1c5db9bdbdd9550b45190b30d8..6f9b10cc831ff748296b9ed30b6de398c90c4786 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
@@ -797,11 +797,11 @@ komeda_improc_validate(struct komeda_improc *improc,
 					 improc->supported_color_formats);
 			return -EINVAL;
 		}
 
 		st->color_depth = __fls(avail_depths);
-		st->color_format = BIT(__ffs(avail_formats));
+		st->color_format = __ffs(avail_formats);
 	}
 
 	if (kcrtc_st->base.color_mgmt_changed) {
 		drm_lut_to_fgamma_coeffs(kcrtc_st->base.gamma_lut,
 					 st->fgamma_coeffs);

-- 
2.52.0


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

* [PATCH 11/14] drm/mediatek: dp: Convert to drm_output_color_format
  2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
                   ` (9 preceding siblings ...)
  2026-02-24 10:58 ` [PATCH 10/14] drm/arm: komeda: " Maxime Ripard
@ 2026-02-24 10:58 ` Maxime Ripard
  2026-02-26  8:58   ` Philipp Zabel
  2026-02-24 10:58 ` [PATCH 12/14] drm/rockchip: analogix: " Maxime Ripard
                   ` (3 subsequent siblings)
  14 siblings, 1 reply; 28+ messages in thread
From: Maxime Ripard @ 2026-02-24 10:58 UTC (permalink / raw)
  To: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

Now that we introduced a new drm_output_color_format enum to represent
what DRM_COLOR_FORMAT_* bits were representing, we can switch to the new
enum.

The main different is that while DRM_COLOR_FORMAT_ was a bitmask,
drm_output_color_format is a proper enum. However, the enum was done is
such a way than DRM_COLOR_FORMAT_X = BIT(DRM_OUTPUT_COLOR_FORMAT_X) so
the transitition is easier.

The only thing we need to consider is if the original code meant to use
that value as a bitmask, in which case we do need to keep the bit shift,
or as a discriminant in which case we don't.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/gpu/drm/mediatek/mtk_dp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
index 5e67dab6e2e91de880282289479cf109087af3f2..24b1b62c286635e51f7f4ddc27d07f4dcef01723 100644
--- a/drivers/gpu/drm/mediatek/mtk_dp.c
+++ b/drivers/gpu/drm/mediatek/mtk_dp.c
@@ -2452,11 +2452,11 @@ static enum drm_mode_status
 mtk_dp_bridge_mode_valid(struct drm_bridge *bridge,
 			 const struct drm_display_info *info,
 			 const struct drm_display_mode *mode)
 {
 	struct mtk_dp *mtk_dp = mtk_dp_from_bridge(bridge);
-	u32 bpp = info->color_formats & DRM_COLOR_FORMAT_YCBCR422 ? 16 : 24;
+	u32 bpp = info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) ? 16 : 24;
 	u32 lane_count_min = mtk_dp->train_info.lane_count;
 	u32 rate = drm_dp_bw_code_to_link_rate(mtk_dp->train_info.link_rate) *
 		   lane_count_min;
 
 	/*
@@ -2519,11 +2519,11 @@ static u32 *mtk_dp_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge,
 	 * datarate of YUV422 and sink device supports YUV422, we output YUV422
 	 * format. Use this condition, we can support more resolution.
 	 */
 	if (((rate * 97 / 100) < (mode->clock * 24 / 8)) &&
 	    ((rate * 97 / 100) > (mode->clock * 16 / 8)) &&
-	    (display_info->color_formats & DRM_COLOR_FORMAT_YCBCR422)) {
+	    (display_info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422))) {
 		input_fmts = kcalloc(1, sizeof(*input_fmts), GFP_KERNEL);
 		if (!input_fmts)
 			return NULL;
 		*num_input_fmts = 1;
 		input_fmts[0] = MEDIA_BUS_FMT_YUYV8_1X16;

-- 
2.52.0


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

* [PATCH 12/14] drm/rockchip: analogix: Convert to drm_output_color_format
  2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
                   ` (10 preceding siblings ...)
  2026-02-24 10:58 ` [PATCH 11/14] drm/mediatek: dp: " Maxime Ripard
@ 2026-02-24 10:58 ` Maxime Ripard
  2026-02-24 10:58 ` [PATCH 13/14] drm/connector: Remove DRM_COLOR_FORMAT defines Maxime Ripard
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2026-02-24 10:58 UTC (permalink / raw)
  To: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

Now that we introduced a new drm_output_color_format enum to represent
what DRM_COLOR_FORMAT_* bits were representing, we can switch to the new
enum.

The main different is that while DRM_COLOR_FORMAT_ was a bitmask,
drm_output_color_format is a proper enum. However, the enum was done is
such a way than DRM_COLOR_FORMAT_X = BIT(DRM_OUTPUT_COLOR_FORMAT_X) so
the transitition is easier.

The only thing we need to consider is if the original code meant to use
that value as a bitmask, in which case we do need to keep the bit shift,
or as a discriminant in which case we don't.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index fdab71d51e2a71d644f128b1bf1c39429b4ad52a..96bd3dd239d251af3d5a7d0fbd4dd74942d44f2d 100644
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -169,16 +169,16 @@ static int rockchip_dp_powerdown(struct analogix_dp_plat_data *plat_data)
 static int rockchip_dp_get_modes(struct analogix_dp_plat_data *plat_data,
 				 struct drm_connector *connector)
 {
 	struct drm_display_info *di = &connector->display_info;
 	/* VOP couldn't output YUV video format for eDP rightly */
-	u32 mask = DRM_COLOR_FORMAT_YCBCR444 | DRM_COLOR_FORMAT_YCBCR422;
+	u32 mask = BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444) | BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
 
 	if ((di->color_formats & mask)) {
 		DRM_DEBUG_KMS("Swapping display color format from YUV to RGB\n");
 		di->color_formats &= ~mask;
-		di->color_formats |= DRM_COLOR_FORMAT_RGB444;
+		di->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444);
 		di->bpc = 8;
 	}
 
 	return 0;
 }

-- 
2.52.0


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

* [PATCH 13/14] drm/connector: Remove DRM_COLOR_FORMAT defines
  2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
                   ` (11 preceding siblings ...)
  2026-02-24 10:58 ` [PATCH 12/14] drm/rockchip: analogix: " Maxime Ripard
@ 2026-02-24 10:58 ` Maxime Ripard
  2026-02-24 10:58 ` [PATCH 14/14] drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace Maxime Ripard
  2026-02-24 12:44 ` [PATCH 00/14] drm: Create drm_output_color_format enum Jani Nikula
  14 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2026-02-24 10:58 UTC (permalink / raw)
  To: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

Now that all users of DRM_COLOR_FORMAT_* defines have been converted to
the new enum, we can get rid of those defines.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 include/drm/drm_connector.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index c67539708f636ae3905bb8424c63799bd1811f28..e97c8a209ef5c96ecf4bcb5f0b1b5f1bc0f35b3c 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -722,15 +722,10 @@ struct drm_display_info {
 	/**
 	 * @subpixel_order: Subpixel order of LCD panels.
 	 */
 	enum subpixel_order subpixel_order;
 
-#define DRM_COLOR_FORMAT_RGB444		(1 << DRM_OUTPUT_COLOR_FORMAT_RGB444)
-#define DRM_COLOR_FORMAT_YCBCR444	(1 << DRM_OUTPUT_COLOR_FORMAT_YCBCR444)
-#define DRM_COLOR_FORMAT_YCBCR422	(1 << DRM_OUTPUT_COLOR_FORMAT_YCBCR422)
-#define DRM_COLOR_FORMAT_YCBCR420	(1 << DRM_OUTPUT_COLOR_FORMAT_YCBCR420)
-
 	/**
 	 * @panel_orientation: Read only connector property for built-in panels,
 	 * indicating the orientation of the panel vs the device's casing.
 	 * drm_connector_init() sets this to DRM_MODE_PANEL_ORIENTATION_UNKNOWN.
 	 * When not UNKNOWN this gets used by the drm_fb_helpers to rotate the

-- 
2.52.0


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

* [PATCH 14/14] drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace
  2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
                   ` (12 preceding siblings ...)
  2026-02-24 10:58 ` [PATCH 13/14] drm/connector: Remove DRM_COLOR_FORMAT defines Maxime Ripard
@ 2026-02-24 10:58 ` Maxime Ripard
  2026-02-24 12:43   ` Jani Nikula
                     ` (2 more replies)
  2026-02-24 12:44 ` [PATCH 00/14] drm: Create drm_output_color_format enum Jani Nikula
  14 siblings, 3 replies; 28+ messages in thread
From: Maxime Ripard @ 2026-02-24 10:58 UTC (permalink / raw)
  To: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

The hdmi_colorspace enum was defined to represent the colorspace value
of the HDMI infoframes. It was later used by some HDMI drivers to
express the output format they should be setting up.

During the introduction of the HDMI helpers, it then was used to
represent it in the drm_connector_hdmi_state structure.

However, it's always been somewhat redundant with the DRM_COLOR_FORMAT_*
defines, and now with the drm_output_color_format enum. Let's
consolidate around drm_output_color_format in drm_connector_hdmi_state
to facilitate the current effort to provide a global output format
selection mechanism.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/gpu/drm/bridge/inno-hdmi.c                 |   6 +-
 drivers/gpu/drm/bridge/ite-it6263.c                |   2 +-
 drivers/gpu/drm/display/drm_hdmi_helper.c          |   7 +-
 drivers/gpu/drm/display/drm_hdmi_state_helper.c    |  52 ++++--
 drivers/gpu/drm/drm_bridge.c                       |   2 +-
 drivers/gpu/drm/drm_connector.c                    |  14 +-
 drivers/gpu/drm/mediatek/mtk_hdmi_v2.c             |   8 +-
 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c             |   2 +-
 drivers/gpu/drm/tests/drm_connector_test.c         |  80 ++++-----
 drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 182 ++++++++++-----------
 drivers/gpu/drm/vc4/vc4_hdmi.c                     |  18 +-
 drivers/gpu/drm/vc4/vc4_hdmi.h                     |   2 +-
 include/drm/display/drm_hdmi_helper.h              |   3 +-
 include/drm/drm_connector.h                        |   7 +-
 14 files changed, 205 insertions(+), 180 deletions(-)

diff --git a/drivers/gpu/drm/bridge/inno-hdmi.c b/drivers/gpu/drm/bridge/inno-hdmi.c
index a26b99b101c4ad04cae15306ce18060fbc52d51a..87422d15d9a2148498fb257667049939788071fd 100644
--- a/drivers/gpu/drm/bridge/inno-hdmi.c
+++ b/drivers/gpu/drm/bridge/inno-hdmi.c
@@ -651,11 +651,11 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi,
 	value = v_VIDEO_INPUT_BITS(VIDEO_INPUT_8BITS) |
 		v_VIDEO_OUTPUT_COLOR(0) |
 		v_VIDEO_INPUT_CSP(0);
 	hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL2, value);
 
-	if (conn_state->hdmi.output_format == HDMI_COLORSPACE_RGB) {
+	if (conn_state->hdmi.output_format == DRM_OUTPUT_COLOR_FORMAT_RGB444) {
 		if (conn_state->hdmi.is_limited_range) {
 			csc_mode = CSC_RGB_0_255_TO_RGB_16_235_8BIT;
 			auto_csc = AUTO_CSC_DISABLE;
 			c0_c2_change = C0_C2_CHANGE_DISABLE;
 			csc_enable = v_CSC_ENABLE;
@@ -670,18 +670,18 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi,
 				  v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE));
 			return 0;
 		}
 	} else {
 		if (colorimetry == HDMI_COLORIMETRY_ITU_601) {
-			if (conn_state->hdmi.output_format == HDMI_COLORSPACE_YUV444) {
+			if (conn_state->hdmi.output_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR444) {
 				csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT;
 				auto_csc = AUTO_CSC_DISABLE;
 				c0_c2_change = C0_C2_CHANGE_DISABLE;
 				csc_enable = v_CSC_ENABLE;
 			}
 		} else {
-			if (conn_state->hdmi.output_format == HDMI_COLORSPACE_YUV444) {
+			if (conn_state->hdmi.output_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR444) {
 				csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT;
 				auto_csc = AUTO_CSC_DISABLE;
 				c0_c2_change = C0_C2_CHANGE_DISABLE;
 				csc_enable = v_CSC_ENABLE;
 			}
diff --git a/drivers/gpu/drm/bridge/ite-it6263.c b/drivers/gpu/drm/bridge/ite-it6263.c
index 3991fb76143c97cda5f0e1d33eba14c58ff8c5d4..dd3fbfc43a438a8fa064ff5551f17584f3286d2f 100644
--- a/drivers/gpu/drm/bridge/ite-it6263.c
+++ b/drivers/gpu/drm/bridge/ite-it6263.c
@@ -664,11 +664,11 @@ it6263_bridge_mode_valid(struct drm_bridge *bridge,
 			 const struct drm_display_info *info,
 			 const struct drm_display_mode *mode)
 {
 	unsigned long long rate;
 
-	rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(mode, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	if (rate == 0)
 		return MODE_NOCLOCK;
 
 	return bridge->funcs->hdmi_tmds_char_rate_valid(bridge, mode, rate);
 }
diff --git a/drivers/gpu/drm/display/drm_hdmi_helper.c b/drivers/gpu/drm/display/drm_hdmi_helper.c
index a237dc55805d0decf0773f3dccb71868861486c2..5cb0b033b1713ee9e3aee46503aeaa2cdb8306b1 100644
--- a/drivers/gpu/drm/display/drm_hdmi_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_helper.c
@@ -208,11 +208,12 @@ EXPORT_SYMBOL(drm_hdmi_avi_infoframe_content_type);
  * RETURNS:
  * The TMDS Character Rate, in Hertz, or 0 on error.
  */
 unsigned long long
 drm_hdmi_compute_mode_clock(const struct drm_display_mode *mode,
-			    unsigned int bpc, enum hdmi_colorspace fmt)
+			    unsigned int bpc,
+			    enum drm_output_color_format fmt)
 {
 	unsigned long long clock = mode->clock * 1000ULL;
 	unsigned int vic = drm_match_cea_mode(mode);
 
 	/*
@@ -220,11 +221,11 @@ drm_hdmi_compute_mode_clock(const struct drm_display_mode *mode,
 	 * mandates that VIC 1 always uses 8 bpc.
 	 */
 	if (vic == 1 && bpc != 8)
 		return 0;
 
-	if (fmt == HDMI_COLORSPACE_YUV422) {
+	if (fmt == DRM_OUTPUT_COLOR_FORMAT_YCBCR422) {
 		/*
 		 * HDMI 1.0 Spec, section 6.5 - Pixel Encoding states that
 		 * YUV422 sends 24 bits over three channels, with Cb and Cr
 		 * components being sent on odd and even pixels, respectively.
 		 *
@@ -246,11 +247,11 @@ drm_hdmi_compute_mode_clock(const struct drm_display_mode *mode,
 	/*
 	 * HDMI 2.0 Spec, Section 7.1 - YCbCr 4:2:0 Pixel Encoding
 	 * specifies that YUV420 encoding is carried at a TMDS Character Rate
 	 * equal to half the pixel clock rate.
 	 */
-	if (fmt == HDMI_COLORSPACE_YUV420)
+	if (fmt == DRM_OUTPUT_COLOR_FORMAT_YCBCR420)
 		clock = clock / 2;
 
 	if (mode->flags & DRM_MODE_FLAG_DBLCLK)
 		clock = clock * 2;
 
diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
index f2aec6f65e7a374cea9a1e3adafb4f1cc4d6ab9a..9f3b696aceeb4b60e6e7dea6bc5458ce5027a4aa 100644
--- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
@@ -324,10 +324,29 @@ void __drm_atomic_helper_connector_hdmi_reset(struct drm_connector *connector,
 	new_conn_state->max_requested_bpc = max_bpc;
 	new_conn_state->hdmi.broadcast_rgb = DRM_HDMI_BROADCAST_RGB_AUTO;
 }
 EXPORT_SYMBOL(__drm_atomic_helper_connector_hdmi_reset);
 
+static enum hdmi_colorspace
+output_color_format_to_hdmi_colorspace(const struct drm_connector *connector,
+				       enum drm_output_color_format fmt)
+{
+	switch (fmt) {
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR420:
+		return HDMI_COLORSPACE_YUV420;
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR422:
+		return HDMI_COLORSPACE_YUV422;
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR444:
+		return HDMI_COLORSPACE_YUV444;
+	default:
+		drm_warn(connector->dev, "Unsupported output color format. Defaulting to RGB.");
+		fallthrough;
+	case DRM_OUTPUT_COLOR_FORMAT_RGB444:
+		return HDMI_COLORSPACE_RGB;
+	}
+}
+
 static const struct drm_display_mode *
 connector_state_get_mode(const struct drm_connector_state *conn_state)
 {
 	struct drm_atomic_state *state;
 	struct drm_crtc_state *crtc_state;
@@ -358,11 +377,11 @@ static bool hdmi_is_limited_range(const struct drm_connector *connector,
 	/*
 	 * The Broadcast RGB property only applies to RGB format, and
 	 * i915 just assumes limited range for YCbCr output, so let's
 	 * just do the same.
 	 */
-	if (conn_state->hdmi.output_format != HDMI_COLORSPACE_RGB)
+	if (conn_state->hdmi.output_format != DRM_OUTPUT_COLOR_FORMAT_RGB444)
 		return true;
 
 	if (conn_state->hdmi.broadcast_rgb == DRM_HDMI_BROADCAST_RGB_FULL)
 		return false;
 
@@ -377,11 +396,12 @@ static bool hdmi_is_limited_range(const struct drm_connector *connector,
 
 static bool
 sink_supports_format_bpc(const struct drm_connector *connector,
 			 const struct drm_display_info *info,
 			 const struct drm_display_mode *mode,
-			 unsigned int format, unsigned int bpc)
+			 enum drm_output_color_format format,
+			 unsigned int bpc)
 {
 	struct drm_device *dev = connector->dev;
 	u8 vic = drm_match_cea_mode(mode);
 
 	/*
@@ -398,28 +418,28 @@ sink_supports_format_bpc(const struct drm_connector *connector,
 		drm_dbg_kms(dev, "VIC1 requires a bpc of 8, got %u\n", bpc);
 		return false;
 	}
 
 	if (!info->is_hdmi &&
-	    (format != HDMI_COLORSPACE_RGB || bpc != 8)) {
+	    (format != DRM_OUTPUT_COLOR_FORMAT_RGB444 || bpc != 8)) {
 		drm_dbg_kms(dev, "DVI Monitors require an RGB output at 8 bpc\n");
 		return false;
 	}
 
 	if (!(connector->hdmi.supported_formats & BIT(format))) {
 		drm_dbg_kms(dev, "%s format unsupported by the connector.\n",
 			    drm_hdmi_connector_get_output_format_name(format));
 		return false;
 	}
 
-	if (drm_mode_is_420_only(info, mode) && format != HDMI_COLORSPACE_YUV420) {
+	if (drm_mode_is_420_only(info, mode) && format != DRM_OUTPUT_COLOR_FORMAT_YCBCR420) {
 		drm_dbg_kms(dev, "Mode can be only supported in YUV420 format.\n");
 		return false;
 	}
 
 	switch (format) {
-	case HDMI_COLORSPACE_RGB:
+	case DRM_OUTPUT_COLOR_FORMAT_RGB444:
 		drm_dbg_kms(dev, "RGB Format, checking the constraints.\n");
 
 		/*
 		 * In some cases, like when the EDID readout fails, or
 		 * is not an HDMI compliant EDID for some reason, the
@@ -443,11 +463,11 @@ sink_supports_format_bpc(const struct drm_connector *connector,
 
 		drm_dbg_kms(dev, "RGB format supported in that configuration.\n");
 
 		return true;
 
-	case HDMI_COLORSPACE_YUV420:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR420:
 		drm_dbg_kms(dev, "YUV420 format, checking the constraints.\n");
 
 		if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420))) {
 			drm_dbg_kms(dev, "Sink doesn't support YUV420.\n");
 			return false;
@@ -475,11 +495,11 @@ sink_supports_format_bpc(const struct drm_connector *connector,
 
 		drm_dbg_kms(dev, "YUV420 format supported in that configuration.\n");
 
 		return true;
 
-	case HDMI_COLORSPACE_YUV422:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR422:
 		drm_dbg_kms(dev, "YUV422 format, checking the constraints.\n");
 
 		if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422))) {
 			drm_dbg_kms(dev, "Sink doesn't support YUV422.\n");
 			return false;
@@ -498,11 +518,11 @@ sink_supports_format_bpc(const struct drm_connector *connector,
 
 		drm_dbg_kms(dev, "YUV422 format supported in that configuration.\n");
 
 		return true;
 
-	case HDMI_COLORSPACE_YUV444:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR444:
 		drm_dbg_kms(dev, "YUV444 format, checking the constraints.\n");
 
 		if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444))) {
 			drm_dbg_kms(dev, "Sink doesn't support YUV444.\n");
 			return false;
@@ -551,11 +571,11 @@ hdmi_clock_valid(const struct drm_connector *connector,
 
 static int
 hdmi_compute_clock(const struct drm_connector *connector,
 		   struct drm_connector_state *conn_state,
 		   const struct drm_display_mode *mode,
-		   unsigned int bpc, enum hdmi_colorspace fmt)
+		   unsigned int bpc, enum drm_output_color_format fmt)
 {
 	enum drm_mode_status status;
 	unsigned long long clock;
 
 	clock = drm_hdmi_compute_mode_clock(mode, bpc, fmt);
@@ -573,11 +593,11 @@ hdmi_compute_clock(const struct drm_connector *connector,
 
 static bool
 hdmi_try_format_bpc(const struct drm_connector *connector,
 		    struct drm_connector_state *conn_state,
 		    const struct drm_display_mode *mode,
-		    unsigned int bpc, enum hdmi_colorspace fmt)
+		    unsigned int bpc, enum drm_output_color_format fmt)
 {
 	const struct drm_display_info *info = &connector->display_info;
 	struct drm_device *dev = connector->dev;
 	int ret;
 
@@ -609,11 +629,11 @@ hdmi_try_format_bpc(const struct drm_connector *connector,
 
 static int
 hdmi_compute_format_bpc(const struct drm_connector *connector,
 			struct drm_connector_state *conn_state,
 			const struct drm_display_mode *mode,
-			unsigned int max_bpc, enum hdmi_colorspace fmt)
+			unsigned int max_bpc, enum drm_output_color_format fmt)
 {
 	struct drm_device *dev = connector->dev;
 	unsigned int bpc;
 	int ret;
 
@@ -650,16 +670,16 @@ hdmi_compute_config(const struct drm_connector *connector,
 				       conn_state->max_bpc,
 				       8, connector->max_bpc);
 	int ret;
 
 	ret = hdmi_compute_format_bpc(connector, conn_state, mode, max_bpc,
-				      HDMI_COLORSPACE_RGB);
+				      DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	if (ret) {
 		if (connector->ycbcr_420_allowed) {
 			ret = hdmi_compute_format_bpc(connector, conn_state,
 						      mode, max_bpc,
-						      HDMI_COLORSPACE_YUV420);
+						      DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
 			if (ret)
 				drm_dbg_kms(connector->dev,
 					    "YUV420 output format doesn't work.\n");
 		} else {
 			drm_dbg_kms(connector->dev,
@@ -689,11 +709,13 @@ static int hdmi_generate_avi_infoframe(const struct drm_connector *connector,
 
 	ret = drm_hdmi_avi_infoframe_from_display_mode(frame, connector, mode);
 	if (ret)
 		return ret;
 
-	frame->colorspace = conn_state->hdmi.output_format;
+	frame->colorspace =
+		output_color_format_to_hdmi_colorspace(connector,
+						       conn_state->hdmi.output_format);
 
 	/*
 	 * FIXME: drm_hdmi_avi_infoframe_quant_range() doesn't handle
 	 * YUV formats at all at the moment, so if we ever support YUV
 	 * formats this needs to be revised.
@@ -887,11 +909,11 @@ enum drm_mode_status
 drm_hdmi_connector_mode_valid(struct drm_connector *connector,
 			      const struct drm_display_mode *mode)
 {
 	unsigned long long clock;
 
-	clock = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB);
+	clock = drm_hdmi_compute_mode_clock(mode, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	if (!clock)
 		return MODE_ERROR;
 
 	return hdmi_clock_valid(connector, mode, clock);
 }
diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index 3b165a0d1e779ebcf7fe710a28ce3d15d7ab9c81..5f6177f4d5f0370604bdea3f943c6a313765aab3 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -385,11 +385,11 @@ void drm_bridge_add(struct drm_bridge *bridge)
 
 	mutex_init(&bridge->hpd_mutex);
 
 	if (bridge->ops & DRM_BRIDGE_OP_HDMI)
 		bridge->ycbcr_420_allowed = !!(bridge->supported_formats &
-					       BIT(HDMI_COLORSPACE_YUV420));
+					       BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420));
 
 	mutex_lock(&bridge_lock);
 	list_add_tail(&bridge->list, &bridge_list);
 	mutex_unlock(&bridge_lock);
 }
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 4f5b27fab475c7c733622eb8727927571f3fb8fe..171cd495976a3e16f201fd339d3d42a09dc3b63f 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -589,14 +589,14 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
 
 	if (!(connector_type == DRM_MODE_CONNECTOR_HDMIA ||
 	      connector_type == DRM_MODE_CONNECTOR_HDMIB))
 		return -EINVAL;
 
-	if (!supported_formats || !(supported_formats & BIT(HDMI_COLORSPACE_RGB)))
+	if (!supported_formats || !(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444)))
 		return -EINVAL;
 
-	if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(HDMI_COLORSPACE_YUV420)))
+	if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)))
 		return -EINVAL;
 
 	if (!(max_bpc == 8 || max_bpc == 10 || max_bpc == 12))
 		return -EINVAL;
 
@@ -1424,25 +1424,25 @@ drm_hdmi_connector_get_broadcast_rgb_name(enum drm_hdmi_broadcast_rgb broadcast_
 	return broadcast_rgb_names[broadcast_rgb].name;
 }
 EXPORT_SYMBOL(drm_hdmi_connector_get_broadcast_rgb_name);
 
 static const char * const output_format_str[] = {
-	[HDMI_COLORSPACE_RGB]		= "RGB",
-	[HDMI_COLORSPACE_YUV420]	= "YUV 4:2:0",
-	[HDMI_COLORSPACE_YUV422]	= "YUV 4:2:2",
-	[HDMI_COLORSPACE_YUV444]	= "YUV 4:4:4",
+	[DRM_OUTPUT_COLOR_FORMAT_RGB444]	= "RGB",
+	[DRM_OUTPUT_COLOR_FORMAT_YCBCR420]	= "YUV 4:2:0",
+	[DRM_OUTPUT_COLOR_FORMAT_YCBCR422]	= "YUV 4:2:2",
+	[DRM_OUTPUT_COLOR_FORMAT_YCBCR444]	= "YUV 4:4:4",
 };
 
 /*
  * drm_hdmi_connector_get_output_format_name() - Return a string for HDMI connector output format
  * @fmt: Output format to compute name of
  *
  * Returns: the name of the output format, or NULL if the type is not
  * valid.
  */
 const char *
-drm_hdmi_connector_get_output_format_name(enum hdmi_colorspace fmt)
+drm_hdmi_connector_get_output_format_name(enum drm_output_color_format fmt)
 {
 	if (fmt >= ARRAY_SIZE(output_format_str))
 		return NULL;
 
 	return output_format_str[fmt];
diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c b/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c
index 279ca896b0a2a25e9dfd254be120e6ed0108b513..b5c738380dc2537d0a8deee73e99c95dde1d2c37 100644
--- a/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi_v2.c
@@ -745,27 +745,27 @@ static void mtk_hdmi_v2_change_video_resolution(struct mtk_hdmi *hdmi,
 	/* Enable scrambling if tmds clock is 340MHz or more */
 	mtk_hdmi_v2_enable_scrambling(hdmi, hdmi->mode.clock >= 340 * KILO);
 
 	switch (conn_state->hdmi.output_format) {
 	default:
-	case HDMI_COLORSPACE_RGB:
-	case HDMI_COLORSPACE_YUV444:
+	case DRM_OUTPUT_COLOR_FORMAT_RGB444:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR444:
 		/* Disable YUV420 downsampling for RGB and YUV444 */
 		mtk_hdmi_yuv420_downsampling(hdmi, false);
 		break;
-	case HDMI_COLORSPACE_YUV422:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR422:
 		/*
 		 * YUV420 downsampling is special and needs a bit of setup
 		 * so we disable everything there before doing anything else.
 		 *
 		 * YUV422 downsampling instead just needs one bit to be set.
 		 */
 		mtk_hdmi_yuv420_downsampling(hdmi, false);
 		regmap_set_bits(hdmi->regs, VID_DOWNSAMPLE_CONFIG,
 				C444_C422_CONFIG_ENABLE);
 		break;
-	case HDMI_COLORSPACE_YUV420:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR420:
 		mtk_hdmi_yuv420_downsampling(hdmi, true);
 		break;
 	}
 }
 
diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
index a50f260c73e41493528e545591aaad0e3f138be2..dd2a78defdb4b93f454d2af6167a3d4e83e3d542 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -659,11 +659,11 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master,
 				       "AW", "HDMI",
 				       &sun4i_hdmi_connector_funcs,
 				       &sun4i_hdmi_hdmi_connector_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       hdmi->ddc_i2c,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       8);
 	if (ret) {
 		dev_err(dev,
 			"Couldn't initialise the HDMI connector\n");
 		goto err_cleanup_connector;
diff --git a/drivers/gpu/drm/tests/drm_connector_test.c b/drivers/gpu/drm/tests/drm_connector_test.c
index 86860ad0861c8eadbd7afd5d36500b7ab4d57433..beb1d50a6646419fed8d1e3b213decefbf18e190 100644
--- a/drivers/gpu/drm/tests/drm_connector_test.c
+++ b/drivers/gpu/drm/tests/drm_connector_test.c
@@ -673,11 +673,11 @@ static void drm_test_connector_hdmi_init_valid(struct kunit *test)
 				       "Vendor", "Product",
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       8);
 	KUNIT_EXPECT_EQ(test, ret, 0);
 }
 
 /*
@@ -693,11 +693,11 @@ static void drm_test_connector_hdmi_init_null_ddc(struct kunit *test)
 				       "Vendor", "Product",
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       NULL,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       8);
 	KUNIT_EXPECT_EQ(test, ret, 0);
 }
 
 /*
@@ -713,11 +713,11 @@ static void drm_test_connector_hdmi_init_null_vendor(struct kunit *test)
 				       NULL, "Product",
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       8);
 	KUNIT_EXPECT_LT(test, ret, 0);
 }
 
 /*
@@ -733,11 +733,11 @@ static void drm_test_connector_hdmi_init_null_product(struct kunit *test)
 				       "Vendor", NULL,
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       8);
 	KUNIT_EXPECT_LT(test, ret, 0);
 }
 
 /*
@@ -759,11 +759,11 @@ static void drm_test_connector_hdmi_init_product_valid(struct kunit *test)
 				       "Vendor", product_name,
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       8);
 	KUNIT_EXPECT_EQ(test, ret, 0);
 	KUNIT_EXPECT_MEMEQ(test,
 			   priv->connector.hdmi.product,
 			   expected_product,
@@ -792,11 +792,11 @@ static void drm_test_connector_hdmi_init_product_length_exact(struct kunit *test
 				       "Vendor", product_name,
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       8);
 	KUNIT_EXPECT_EQ(test, ret, 0);
 	KUNIT_EXPECT_MEMEQ(test,
 			   priv->connector.hdmi.product,
 			   expected_product,
@@ -819,11 +819,11 @@ static void drm_test_connector_hdmi_init_product_length_too_long(struct kunit *t
 				       "Vendor", product_name,
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       8);
 	KUNIT_EXPECT_LT(test, ret, 0);
 }
 
 /*
@@ -845,11 +845,11 @@ static void drm_test_connector_hdmi_init_vendor_valid(struct kunit *test)
 				       vendor_name, "Product",
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       8);
 	KUNIT_EXPECT_EQ(test, ret, 0);
 	KUNIT_EXPECT_MEMEQ(test,
 			   priv->connector.hdmi.vendor,
 			   expected_vendor,
@@ -877,11 +877,11 @@ static void drm_test_connector_hdmi_init_vendor_length_exact(struct kunit *test)
 				       vendor_name, "Product",
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       8);
 	KUNIT_EXPECT_EQ(test, ret, 0);
 	KUNIT_EXPECT_MEMEQ(test,
 			   priv->connector.hdmi.vendor,
 			   expected_vendor,
@@ -904,11 +904,11 @@ static void drm_test_connector_hdmi_init_vendor_length_too_long(struct kunit *te
 				       vendor_name, "Product",
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       8);
 	KUNIT_EXPECT_LT(test, ret, 0);
 }
 
 /*
@@ -924,11 +924,11 @@ static void drm_test_connector_hdmi_init_bpc_invalid(struct kunit *test)
 				       "Vendor", "Product",
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       9);
 	KUNIT_EXPECT_LT(test, ret, 0);
 }
 
 /*
@@ -944,11 +944,11 @@ static void drm_test_connector_hdmi_init_bpc_null(struct kunit *test)
 				       "Vendor", "Product",
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       0);
 	KUNIT_EXPECT_LT(test, ret, 0);
 }
 
 /*
@@ -969,11 +969,11 @@ static void drm_test_connector_hdmi_init_bpc_8(struct kunit *test)
 				       "Vendor", "Product",
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       8);
 	KUNIT_EXPECT_EQ(test, ret, 0);
 
 	prop = connector->max_bpc_property;
 	KUNIT_ASSERT_NOT_NULL(test, prop);
@@ -1010,11 +1010,11 @@ static void drm_test_connector_hdmi_init_bpc_10(struct kunit *test)
 				       "Vendor", "Product",
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       10);
 	KUNIT_EXPECT_EQ(test, ret, 0);
 
 	prop = connector->max_bpc_property;
 	KUNIT_ASSERT_NOT_NULL(test, prop);
@@ -1051,11 +1051,11 @@ static void drm_test_connector_hdmi_init_bpc_12(struct kunit *test)
 				       "Vendor", "Product",
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       12);
 	KUNIT_EXPECT_EQ(test, ret, 0);
 
 	prop = connector->max_bpc_property;
 	KUNIT_ASSERT_NOT_NULL(test, prop);
@@ -1107,11 +1107,11 @@ static void drm_test_connector_hdmi_init_formats_no_rgb(struct kunit *test)
 				       "Vendor", "Product",
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_YUV422),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422),
 				       8);
 	KUNIT_EXPECT_LT(test, ret, 0);
 }
 
 struct drm_connector_hdmi_init_formats_yuv420_allowed_test {
@@ -1120,21 +1120,21 @@ struct drm_connector_hdmi_init_formats_yuv420_allowed_test {
 	int expected_result;
 };
 
 #define YUV420_ALLOWED_TEST(_formats, _allowed, _result)			\
 	{									\
-		.supported_formats = BIT(HDMI_COLORSPACE_RGB) | (_formats),	\
+		.supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | (_formats),	\
 		.yuv420_allowed = _allowed,					\
 		.expected_result = _result,					\
 	}
 
 static const struct drm_connector_hdmi_init_formats_yuv420_allowed_test
 drm_connector_hdmi_init_formats_yuv420_allowed_tests[] = {
-	YUV420_ALLOWED_TEST(BIT(HDMI_COLORSPACE_YUV420), true, 0),
-	YUV420_ALLOWED_TEST(BIT(HDMI_COLORSPACE_YUV420), false, -EINVAL),
-	YUV420_ALLOWED_TEST(BIT(HDMI_COLORSPACE_YUV422), true, -EINVAL),
-	YUV420_ALLOWED_TEST(BIT(HDMI_COLORSPACE_YUV422), false, 0),
+	YUV420_ALLOWED_TEST(BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420), true, 0),
+	YUV420_ALLOWED_TEST(BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420), false, -EINVAL),
+	YUV420_ALLOWED_TEST(BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422), true, -EINVAL),
+	YUV420_ALLOWED_TEST(BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422), false, 0),
 };
 
 static void
 drm_connector_hdmi_init_formats_yuv420_allowed_desc(const struct drm_connector_hdmi_init_formats_yuv420_allowed_test *t,
 						    char *desc)
@@ -1186,11 +1186,11 @@ static void drm_test_connector_hdmi_init_type_valid(struct kunit *test)
 				       "Vendor", "Product",
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       connector_type,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       8);
 	KUNIT_EXPECT_EQ(test, ret, 0);
 }
 
 static const unsigned int drm_connector_hdmi_init_type_valid_tests[] = {
@@ -1221,11 +1221,11 @@ static void drm_test_connector_hdmi_init_type_invalid(struct kunit *test)
 				       "Vendor", "Product",
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       connector_type,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       8);
 	KUNIT_EXPECT_LT(test, ret, 0);
 }
 
 static const unsigned int drm_connector_hdmi_init_type_invalid_tests[] = {
@@ -1430,14 +1430,14 @@ static void drm_test_drm_hdmi_connector_get_output_format_name(struct kunit *tes
 }
 
 static const
 struct drm_hdmi_connector_get_output_format_name_test
 drm_hdmi_connector_get_output_format_name_valid_tests[] = {
-	OUTPUT_FORMAT_TEST(HDMI_COLORSPACE_RGB, "RGB"),
-	OUTPUT_FORMAT_TEST(HDMI_COLORSPACE_YUV420, "YUV 4:2:0"),
-	OUTPUT_FORMAT_TEST(HDMI_COLORSPACE_YUV422, "YUV 4:2:2"),
-	OUTPUT_FORMAT_TEST(HDMI_COLORSPACE_YUV444, "YUV 4:4:4"),
+	OUTPUT_FORMAT_TEST(DRM_OUTPUT_COLOR_FORMAT_RGB444, "RGB"),
+	OUTPUT_FORMAT_TEST(DRM_OUTPUT_COLOR_FORMAT_YCBCR420, "YUV 4:2:0"),
+	OUTPUT_FORMAT_TEST(DRM_OUTPUT_COLOR_FORMAT_YCBCR422, "YUV 4:2:2"),
+	OUTPUT_FORMAT_TEST(DRM_OUTPUT_COLOR_FORMAT_YCBCR444, "YUV 4:4:4"),
 };
 
 static void
 drm_hdmi_connector_get_output_format_name_valid_desc(const struct drm_hdmi_connector_get_output_format_name_test *t,
 						     char *desc)
@@ -1498,11 +1498,11 @@ static void drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector(
 				       "Vendor", "Product",
 				       &dummy_funcs,
 				       &dummy_hdmi_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       &priv->ddc,
-				       BIT(HDMI_COLORSPACE_RGB),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				       8);
 	KUNIT_EXPECT_EQ(test, ret, 0);
 
 	ret = drm_connector_attach_broadcast_rgb_property(connector);
 	KUNIT_ASSERT_EQ(test, ret, 0);
@@ -1538,11 +1538,11 @@ static void drm_test_drm_hdmi_compute_mode_clock_rgb(struct kunit *test)
 	mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16);
 	KUNIT_ASSERT_NOT_NULL(test, mode);
 
 	KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
 
-	rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(mode, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_ASSERT_GT(test, rate, 0);
 	KUNIT_EXPECT_EQ(test, mode->clock * 1000ULL, rate);
 }
 
 /*
@@ -1559,11 +1559,11 @@ static void drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc(struct kunit *test)
 	mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16);
 	KUNIT_ASSERT_NOT_NULL(test, mode);
 
 	KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
 
-	rate = drm_hdmi_compute_mode_clock(mode, 10, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(mode, 10, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_ASSERT_GT(test, rate, 0);
 	KUNIT_EXPECT_EQ(test, mode->clock * 1250, rate);
 }
 
 /*
@@ -1578,11 +1578,11 @@ static void drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1(struct kunit *t
 	struct drm_device *drm = &priv->drm;
 
 	mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1);
 	KUNIT_ASSERT_NOT_NULL(test, mode);
 
-	rate = drm_hdmi_compute_mode_clock(mode, 10, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(mode, 10, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_EXPECT_EQ(test, rate, 0);
 }
 
 /*
  * Test that for a given mode, with 12bpc and an RGB output the TMDS
@@ -1598,11 +1598,11 @@ static void drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc(struct kunit *test)
 	mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16);
 	KUNIT_ASSERT_NOT_NULL(test, mode);
 
 	KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
 
-	rate = drm_hdmi_compute_mode_clock(mode, 12, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(mode, 12, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_ASSERT_GT(test, rate, 0);
 	KUNIT_EXPECT_EQ(test, mode->clock * 1500, rate);
 }
 
 /*
@@ -1617,11 +1617,11 @@ static void drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1(struct kunit *t
 	struct drm_device *drm = &priv->drm;
 
 	mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1);
 	KUNIT_ASSERT_NOT_NULL(test, mode);
 
-	rate = drm_hdmi_compute_mode_clock(mode, 12, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(mode, 12, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_EXPECT_EQ(test, rate, 0);
 }
 
 /*
  * Test that for a mode with the pixel repetition flag, the TMDS
@@ -1637,11 +1637,11 @@ static void drm_test_drm_hdmi_compute_mode_clock_rgb_double(struct kunit *test)
 	mode = drm_kunit_display_mode_from_cea_vic(test, drm, 6);
 	KUNIT_ASSERT_NOT_NULL(test, mode);
 
 	KUNIT_ASSERT_TRUE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
 
-	rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(mode, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_ASSERT_GT(test, rate, 0);
 	KUNIT_EXPECT_EQ(test, (mode->clock * 1000ULL) * 2, rate);
 }
 
 /*
@@ -1660,11 +1660,11 @@ static void drm_test_connector_hdmi_compute_mode_clock_yuv420_valid(struct kunit
 	mode = drm_kunit_display_mode_from_cea_vic(test, drm, vic);
 	KUNIT_ASSERT_NOT_NULL(test, mode);
 
 	KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
 
-	rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_YUV420);
+	rate = drm_hdmi_compute_mode_clock(mode, 8, DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
 	KUNIT_ASSERT_GT(test, rate, 0);
 	KUNIT_EXPECT_EQ(test, (mode->clock * 1000ULL) / 2, rate);
 }
 
 static const unsigned int drm_hdmi_compute_mode_clock_yuv420_vic_valid_tests[] = {
@@ -1697,11 +1697,11 @@ static void drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc(struct kuni
 	mode = drm_kunit_display_mode_from_cea_vic(test, drm, vic);
 	KUNIT_ASSERT_NOT_NULL(test, mode);
 
 	KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
 
-	rate = drm_hdmi_compute_mode_clock(mode, 10, HDMI_COLORSPACE_YUV420);
+	rate = drm_hdmi_compute_mode_clock(mode, 10, DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
 	KUNIT_ASSERT_GT(test, rate, 0);
 
 	KUNIT_EXPECT_EQ(test, mode->clock * 625, rate);
 }
 
@@ -1722,11 +1722,11 @@ static void drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc(struct kuni
 	mode = drm_kunit_display_mode_from_cea_vic(test, drm, vic);
 	KUNIT_ASSERT_NOT_NULL(test, mode);
 
 	KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
 
-	rate = drm_hdmi_compute_mode_clock(mode, 12, HDMI_COLORSPACE_YUV420);
+	rate = drm_hdmi_compute_mode_clock(mode, 12, DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
 	KUNIT_ASSERT_GT(test, rate, 0);
 
 	KUNIT_EXPECT_EQ(test, mode->clock * 750, rate);
 }
 
@@ -1745,11 +1745,11 @@ static void drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc(struct kunit
 	mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16);
 	KUNIT_ASSERT_NOT_NULL(test, mode);
 
 	KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
 
-	rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_YUV422);
+	rate = drm_hdmi_compute_mode_clock(mode, 8, DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
 	KUNIT_ASSERT_GT(test, rate, 0);
 	KUNIT_EXPECT_EQ(test, mode->clock * 1000, rate);
 }
 
 /*
@@ -1767,11 +1767,11 @@ static void drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc(struct kuni
 	mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16);
 	KUNIT_ASSERT_NOT_NULL(test, mode);
 
 	KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
 
-	rate = drm_hdmi_compute_mode_clock(mode, 10, HDMI_COLORSPACE_YUV422);
+	rate = drm_hdmi_compute_mode_clock(mode, 10, DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
 	KUNIT_ASSERT_GT(test, rate, 0);
 	KUNIT_EXPECT_EQ(test, mode->clock * 1000, rate);
 }
 
 /*
@@ -1789,11 +1789,11 @@ static void drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc(struct kuni
 	mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16);
 	KUNIT_ASSERT_NOT_NULL(test, mode);
 
 	KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
 
-	rate = drm_hdmi_compute_mode_clock(mode, 12, HDMI_COLORSPACE_YUV422);
+	rate = drm_hdmi_compute_mode_clock(mode, 12, DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
 	KUNIT_ASSERT_GT(test, rate, 0);
 	KUNIT_EXPECT_EQ(test, mode->clock * 1000, rate);
 }
 
 static struct kunit_case drm_hdmi_compute_mode_clock_tests[] = {
diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
index 4bdcea3c7435146aebb1716f38d7302ddb7c6296..a4357efaa983dbd10262b4f77fb0581d8d9690c8 100644
--- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
+++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
@@ -237,11 +237,11 @@ __connector_hdmi_init(struct kunit *test,
 	KUNIT_ASSERT_EQ(test, ret, 0);
 
 	enc->possible_crtcs = drm_crtc_mask(priv->crtc);
 
 	conn = &priv->connector;
-	conn->ycbcr_420_allowed = !!(formats & BIT(HDMI_COLORSPACE_YUV420));
+	conn->ycbcr_420_allowed = !!(formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420));
 
 	ret = drmm_connector_hdmi_init(drm, conn,
 				       "Vendor", "Product",
 				       &dummy_connector_funcs,
 				       hdmi_funcs,
@@ -298,11 +298,11 @@ static void drm_test_check_broadcast_rgb_crtc_mode_changed(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 						    8);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	drm = &priv->drm;
 	crtc = priv->crtc;
@@ -373,11 +373,11 @@ static void drm_test_check_broadcast_rgb_crtc_mode_not_changed(struct kunit *tes
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 						    8);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	drm = &priv->drm;
 	crtc = priv->crtc;
@@ -448,11 +448,11 @@ static void drm_test_check_broadcast_rgb_auto_cea_mode(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 						    8);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	drm = &priv->drm;
 	crtc = priv->crtc;
@@ -515,11 +515,11 @@ static void drm_test_check_broadcast_rgb_auto_cea_mode_vic_1(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 						    8);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	drm = &priv->drm;
 	conn = &priv->connector;
@@ -582,11 +582,11 @@ static void drm_test_check_broadcast_rgb_full_cea_mode(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 						    8);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	drm = &priv->drm;
 	crtc = priv->crtc;
@@ -651,11 +651,11 @@ static void drm_test_check_broadcast_rgb_full_cea_mode_vic_1(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 						    8);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	drm = &priv->drm;
 	conn = &priv->connector;
@@ -720,11 +720,11 @@ static void drm_test_check_broadcast_rgb_limited_cea_mode(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 						    8);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	drm = &priv->drm;
 	crtc = priv->crtc;
@@ -789,11 +789,11 @@ static void drm_test_check_broadcast_rgb_limited_cea_mode_vic_1(struct kunit *te
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 						    8);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	drm = &priv->drm;
 	conn = &priv->connector;
@@ -861,12 +861,12 @@ static void drm_test_check_broadcast_rgb_cea_mode_yuv420(struct kunit *test)
 	int ret;
 
 	broadcast_rgb = *(enum drm_hdmi_broadcast_rgb *)test->param_value;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB) |
-				BIT(HDMI_COLORSPACE_YUV420),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) |
+				BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420),
 				8,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -916,11 +916,11 @@ static void drm_test_check_broadcast_rgb_cea_mode_yuv420(struct kunit *test)
 
 	conn_state = drm_atomic_get_new_connector_state(state, conn);
 	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, conn_state);
 
 	KUNIT_ASSERT_EQ(test, conn_state->hdmi.broadcast_rgb, broadcast_rgb);
-	KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_YUV420);
+	KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
 
 	KUNIT_EXPECT_TRUE(test, conn_state->hdmi.is_limited_range);
 
 	drm_modeset_drop_locks(&ctx);
 	drm_modeset_acquire_fini(&ctx);
@@ -961,11 +961,11 @@ static void drm_test_check_output_bpc_crtc_mode_changed(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				10,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -1043,11 +1043,11 @@ static void drm_test_check_output_bpc_crtc_mode_not_changed(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				10,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -1120,13 +1120,13 @@ static void drm_test_check_output_bpc_dvi(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB) |
-				BIT(HDMI_COLORSPACE_YUV422) |
-				BIT(HDMI_COLORSPACE_YUV444),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) |
+				BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) |
+				BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444),
 				12,
 				&dummy_connector_hdmi_funcs,
 				test_edid_dvi_1080p);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -1155,11 +1155,11 @@ static void drm_test_check_output_bpc_dvi(struct kunit *test)
 
 	conn_state = conn->state;
 	KUNIT_ASSERT_NOT_NULL(test, conn_state);
 
 	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_bpc, 8);
-	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB);
+	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 
 	drm_modeset_drop_locks(&ctx);
 	drm_modeset_acquire_fini(&ctx);
 }
 
@@ -1177,11 +1177,11 @@ static void drm_test_check_tmds_char_rate_rgb_8bpc(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				8,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_max_200mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -1208,11 +1208,11 @@ static void drm_test_check_tmds_char_rate_rgb_8bpc(struct kunit *test)
 
 	conn_state = conn->state;
 	KUNIT_ASSERT_NOT_NULL(test, conn_state);
 
 	KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_bpc, 8);
-	KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB);
+	KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_EXPECT_EQ(test, conn_state->hdmi.tmds_char_rate, preferred->clock * 1000);
 
 	drm_modeset_drop_locks(&ctx);
 	drm_modeset_acquire_fini(&ctx);
 }
@@ -1232,11 +1232,11 @@ static void drm_test_check_tmds_char_rate_rgb_10bpc(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				10,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -1263,11 +1263,11 @@ static void drm_test_check_tmds_char_rate_rgb_10bpc(struct kunit *test)
 
 	conn_state = conn->state;
 	KUNIT_ASSERT_NOT_NULL(test, conn_state);
 
 	KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_bpc, 10);
-	KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB);
+	KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_EXPECT_EQ(test, conn_state->hdmi.tmds_char_rate, preferred->clock * 1250);
 
 	drm_modeset_drop_locks(&ctx);
 	drm_modeset_acquire_fini(&ctx);
 }
@@ -1287,11 +1287,11 @@ static void drm_test_check_tmds_char_rate_rgb_12bpc(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				12,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -1318,11 +1318,11 @@ static void drm_test_check_tmds_char_rate_rgb_12bpc(struct kunit *test)
 
 	conn_state = conn->state;
 	KUNIT_ASSERT_NOT_NULL(test, conn_state);
 
 	KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_bpc, 12);
-	KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB);
+	KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_EXPECT_EQ(test, conn_state->hdmi.tmds_char_rate, preferred->clock * 1500);
 
 	drm_modeset_drop_locks(&ctx);
 	drm_modeset_acquire_fini(&ctx);
 }
@@ -1346,11 +1346,11 @@ static void drm_test_check_hdmi_funcs_reject_rate(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 						    8);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	drm = &priv->drm;
 	crtc = priv->crtc;
@@ -1414,11 +1414,11 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_rgb(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				12,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -1431,14 +1431,14 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_rgb(struct kunit *test)
 
 	preferred = find_preferred_mode(conn);
 	KUNIT_ASSERT_NOT_NULL(test, preferred);
 	KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK);
 
-	rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_ASSERT_GT(test, rate, info->max_tmds_clock * 1000);
 
-	rate = drm_hdmi_compute_mode_clock(preferred, 10, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(preferred, 10, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
 
 	drm_modeset_acquire_init(&ctx, 0);
 
 retry_conn_enable:
@@ -1455,11 +1455,11 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_rgb(struct kunit *test)
 
 	conn_state = conn->state;
 	KUNIT_ASSERT_NOT_NULL(test, conn_state);
 
 	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_bpc, 10);
-	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB);
+	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_EXPECT_EQ(test, conn_state->hdmi.tmds_char_rate, preferred->clock * 1250);
 
 	drm_modeset_drop_locks(&ctx);
 	drm_modeset_acquire_fini(&ctx);
 }
@@ -1488,12 +1488,12 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_yuv420(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB) |
-				BIT(HDMI_COLORSPACE_YUV420),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) |
+				BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420),
 				12,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -1507,14 +1507,14 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_yuv420(struct kunit *test)
 
 	yuv420_only_mode = drm_kunit_display_mode_from_cea_vic(test, drm, 95);
 	KUNIT_ASSERT_NOT_NULL(test, yuv420_only_mode);
 	KUNIT_ASSERT_TRUE(test, drm_mode_is_420_only(info, yuv420_only_mode));
 
-	rate = drm_hdmi_compute_mode_clock(yuv420_only_mode, 12, HDMI_COLORSPACE_YUV420);
+	rate = drm_hdmi_compute_mode_clock(yuv420_only_mode, 12, DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
 	KUNIT_ASSERT_GT(test, rate, info->max_tmds_clock * 1000);
 
-	rate = drm_hdmi_compute_mode_clock(yuv420_only_mode, 10, HDMI_COLORSPACE_YUV420);
+	rate = drm_hdmi_compute_mode_clock(yuv420_only_mode, 10, DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
 	KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
 
 	drm_modeset_acquire_init(&ctx, 0);
 
 retry_conn_enable:
@@ -1529,11 +1529,11 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_yuv420(struct kunit *test)
 
 	conn_state = conn->state;
 	KUNIT_ASSERT_NOT_NULL(test, conn_state);
 
 	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_bpc, 10);
-	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_YUV420);
+	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
 	KUNIT_EXPECT_EQ(test, conn_state->hdmi.tmds_char_rate, yuv420_only_mode->clock * 625);
 
 	drm_modeset_drop_locks(&ctx);
 	drm_modeset_acquire_fini(&ctx);
 }
@@ -1563,13 +1563,13 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv422(struct kunit
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB) |
-				BIT(HDMI_COLORSPACE_YUV422) |
-				BIT(HDMI_COLORSPACE_YUV444),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) |
+				BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) |
+				BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444),
 				12,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -1582,17 +1582,17 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv422(struct kunit
 
 	preferred = find_preferred_mode(conn);
 	KUNIT_ASSERT_NOT_NULL(test, preferred);
 	KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK);
 
-	rate = drm_hdmi_compute_mode_clock(preferred, 10, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(preferred, 10, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
 
-	rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_ASSERT_GT(test, rate, info->max_tmds_clock * 1000);
 
-	rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV422);
+	rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
 	KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
 
 	drm_modeset_acquire_init(&ctx, 0);
 
 retry_conn_enable:
@@ -1609,11 +1609,11 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv422(struct kunit
 
 	conn_state = conn->state;
 	KUNIT_ASSERT_NOT_NULL(test, conn_state);
 
 	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_bpc, 10);
-	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB);
+	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 
 	drm_modeset_drop_locks(&ctx);
 	drm_modeset_acquire_fini(&ctx);
 }
 
@@ -1642,12 +1642,12 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv420(struct kunit
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB) |
-				BIT(HDMI_COLORSPACE_YUV420),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) |
+				BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420),
 				12,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -1662,17 +1662,17 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv420(struct kunit
 	preferred = find_preferred_mode(conn);
 	KUNIT_ASSERT_NOT_NULL(test, preferred);
 	KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK);
 	KUNIT_ASSERT_TRUE(test, drm_mode_is_420_also(info, preferred));
 
-	rate = drm_hdmi_compute_mode_clock(preferred, 8, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(preferred, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
 
-	rate = drm_hdmi_compute_mode_clock(preferred, 10, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(preferred, 10, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_ASSERT_GT(test, rate, info->max_tmds_clock * 1000);
 
-	rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV420);
+	rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
 	KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
 
 	drm_modeset_acquire_init(&ctx, 0);
 
 retry_conn_enable:
@@ -1687,11 +1687,11 @@ static void drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv420(struct kunit
 
 	conn_state = conn->state;
 	KUNIT_ASSERT_NOT_NULL(test, conn_state);
 
 	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_bpc, 8);
-	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB);
+	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 
 	drm_modeset_drop_locks(&ctx);
 	drm_modeset_acquire_fini(&ctx);
 }
 
@@ -1713,11 +1713,11 @@ static void drm_test_check_driver_unsupported_fallback_yuv420(struct kunit *test
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				12,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -1748,11 +1748,11 @@ static void drm_test_check_driver_unsupported_fallback_yuv420(struct kunit *test
 	}
 	KUNIT_EXPECT_EQ(test, ret, 0);
 
 	conn_state = conn->state;
 	KUNIT_ASSERT_NOT_NULL(test, conn_state);
-	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB);
+	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 
 	state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx);
 	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, state);
 
 retry_crtc_state:
@@ -1798,13 +1798,13 @@ static void drm_test_check_output_bpc_format_vic_1(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB) |
-				BIT(HDMI_COLORSPACE_YUV422) |
-				BIT(HDMI_COLORSPACE_YUV444),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) |
+				BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) |
+				BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444),
 				12,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -1845,11 +1845,11 @@ static void drm_test_check_output_bpc_format_vic_1(struct kunit *test)
 
 	conn_state = conn->state;
 	KUNIT_ASSERT_NOT_NULL(test, conn_state);
 
 	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_bpc, 8);
-	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB);
+	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 
 	drm_modeset_drop_locks(&ctx);
 	drm_modeset_acquire_fini(&ctx);
 }
 
@@ -1869,11 +1869,11 @@ static void drm_test_check_output_bpc_format_driver_rgb_only(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				12,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -1894,14 +1894,14 @@ static void drm_test_check_output_bpc_format_driver_rgb_only(struct kunit *test)
 	 * by the display, and YUV422 works for that display.
 	 *
 	 * But since the driver only supports RGB, we should fallback to
 	 * a lower bpc with RGB.
 	 */
-	rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_ASSERT_GT(test, rate, info->max_tmds_clock * 1000);
 
-	rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV422);
+	rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
 	KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
 
 	drm_modeset_acquire_init(&ctx, 0);
 
 retry_conn_enable:
@@ -1918,11 +1918,11 @@ static void drm_test_check_output_bpc_format_driver_rgb_only(struct kunit *test)
 
 	conn_state = conn->state;
 	KUNIT_ASSERT_NOT_NULL(test, conn_state);
 
 	KUNIT_EXPECT_LT(test, conn_state->hdmi.output_bpc, 12);
-	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB);
+	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 
 	drm_modeset_drop_locks(&ctx);
 	drm_modeset_acquire_fini(&ctx);
 }
 
@@ -1942,13 +1942,13 @@ static void drm_test_check_output_bpc_format_display_rgb_only(struct kunit *test
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB) |
-				BIT(HDMI_COLORSPACE_YUV422) |
-				BIT(HDMI_COLORSPACE_YUV444),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) |
+				BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) |
+				BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444),
 				12,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_max_200mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -1969,14 +1969,14 @@ static void drm_test_check_output_bpc_format_display_rgb_only(struct kunit *test
 	 * by the display, and YUV422 works for that display.
 	 *
 	 * But since the display only supports RGB, we should fallback to
 	 * a lower bpc with RGB.
 	 */
-	rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_ASSERT_GT(test, rate, info->max_tmds_clock * 1000);
 
-	rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV422);
+	rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
 	KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
 
 	drm_modeset_acquire_init(&ctx, 0);
 
 retry_conn_enable:
@@ -1993,11 +1993,11 @@ static void drm_test_check_output_bpc_format_display_rgb_only(struct kunit *test
 
 	conn_state = conn->state;
 	KUNIT_ASSERT_NOT_NULL(test, conn_state);
 
 	KUNIT_EXPECT_LT(test, conn_state->hdmi.output_bpc, 12);
-	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB);
+	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 
 	drm_modeset_drop_locks(&ctx);
 	drm_modeset_acquire_fini(&ctx);
 }
 
@@ -2018,11 +2018,11 @@ static void drm_test_check_output_bpc_format_driver_8bpc_only(struct kunit *test
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				8,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -2038,11 +2038,11 @@ static void drm_test_check_output_bpc_format_driver_8bpc_only(struct kunit *test
 
 	/*
 	 * We're making sure that we have headroom on the TMDS character
 	 * clock to actually use 12bpc.
 	 */
-	rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
 
 	drm_modeset_acquire_init(&ctx, 0);
 
 retry_conn_enable:
@@ -2059,11 +2059,11 @@ static void drm_test_check_output_bpc_format_driver_8bpc_only(struct kunit *test
 
 	conn_state = conn->state;
 	KUNIT_ASSERT_NOT_NULL(test, conn_state);
 
 	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_bpc, 8);
-	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB);
+	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 
 	drm_modeset_drop_locks(&ctx);
 	drm_modeset_acquire_fini(&ctx);
 }
 
@@ -2084,13 +2084,13 @@ static void drm_test_check_output_bpc_format_display_8bpc_only(struct kunit *tes
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB) |
-				BIT(HDMI_COLORSPACE_YUV422) |
-				BIT(HDMI_COLORSPACE_YUV444),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) |
+				BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) |
+				BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444),
 				12,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_max_340mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -2106,11 +2106,11 @@ static void drm_test_check_output_bpc_format_display_8bpc_only(struct kunit *tes
 
 	/*
 	 * We're making sure that we have headroom on the TMDS character
 	 * clock to actually use 12bpc.
 	 */
-	rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB);
+	rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 	KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
 
 	drm_modeset_acquire_init(&ctx, 0);
 
 retry_conn_enable:
@@ -2127,11 +2127,11 @@ static void drm_test_check_output_bpc_format_display_8bpc_only(struct kunit *tes
 
 	conn_state = conn->state;
 	KUNIT_ASSERT_NOT_NULL(test, conn_state);
 
 	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_bpc, 8);
-	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB);
+	KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444);
 
 	drm_modeset_drop_locks(&ctx);
 	drm_modeset_acquire_fini(&ctx);
 }
 
@@ -2148,11 +2148,11 @@ static void drm_test_check_disable_connector(struct kunit *test)
 	struct drm_device *drm;
 	struct drm_crtc *crtc;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 						    8);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	drm_modeset_acquire_init(&ctx, 0);
 
@@ -2253,11 +2253,11 @@ static void drm_test_check_broadcast_rgb_value(struct kunit *test)
 	struct drm_atomic_helper_connector_hdmi_priv *priv;
 	struct drm_connector_state *conn_state;
 	struct drm_connector *conn;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 						    8);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	conn = &priv->connector;
 	conn_state = conn->state;
@@ -2275,11 +2275,11 @@ static void drm_test_check_bpc_8_value(struct kunit *test)
 	struct drm_atomic_helper_connector_hdmi_priv *priv;
 	struct drm_connector_state *conn_state;
 	struct drm_connector *conn;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 						    8);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	conn = &priv->connector;
 	conn_state = conn->state;
@@ -2299,11 +2299,11 @@ static void drm_test_check_bpc_10_value(struct kunit *test)
 	struct drm_atomic_helper_connector_hdmi_priv *priv;
 	struct drm_connector_state *conn_state;
 	struct drm_connector *conn;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 						    10);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	conn = &priv->connector;
 	conn_state = conn->state;
@@ -2323,11 +2323,11 @@ static void drm_test_check_bpc_12_value(struct kunit *test)
 	struct drm_atomic_helper_connector_hdmi_priv *priv;
 	struct drm_connector_state *conn_state;
 	struct drm_connector *conn;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 						    12);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	conn = &priv->connector;
 	conn_state = conn->state;
@@ -2345,13 +2345,13 @@ static void drm_test_check_format_value(struct kunit *test)
 	struct drm_atomic_helper_connector_hdmi_priv *priv;
 	struct drm_connector_state *conn_state;
 	struct drm_connector *conn;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB) |
-						    BIT(HDMI_COLORSPACE_YUV422) |
-						    BIT(HDMI_COLORSPACE_YUV444),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) |
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) |
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444),
 						    8);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	conn = &priv->connector;
 	conn_state = conn->state;
@@ -2367,13 +2367,13 @@ static void drm_test_check_tmds_char_value(struct kunit *test)
 	struct drm_atomic_helper_connector_hdmi_priv *priv;
 	struct drm_connector_state *conn_state;
 	struct drm_connector *conn;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB) |
-						    BIT(HDMI_COLORSPACE_YUV422) |
-						    BIT(HDMI_COLORSPACE_YUV444),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) |
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) |
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444),
 						    12);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	conn = &priv->connector;
 	conn_state = conn->state;
@@ -2405,11 +2405,11 @@ static void drm_test_check_mode_valid(struct kunit *test)
 	struct drm_atomic_helper_connector_hdmi_priv *priv;
 	struct drm_connector *conn;
 	struct drm_display_mode *preferred;
 
 	priv = drm_kunit_helper_connector_hdmi_init(test,
-						    BIT(HDMI_COLORSPACE_RGB),
+						    BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 						    8);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
 	conn = &priv->connector;
 	preferred = find_preferred_mode(conn);
@@ -2429,11 +2429,11 @@ static void drm_test_check_mode_valid_reject_rate(struct kunit *test)
 {
 	struct drm_atomic_helper_connector_hdmi_priv *priv;
 	struct drm_display_mode *preferred;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-					BIT(HDMI_COLORSPACE_RGB),
+					BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 					8,
 					&reject_100mhz_connector_hdmi_funcs,
 					test_edid_hdmi_1080p_rgb_max_200mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -2461,11 +2461,11 @@ static void drm_test_check_mode_valid_reject(struct kunit *test)
 	struct drm_display_mode *preferred;
 	unsigned char no_edid[] = {};
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-					BIT(HDMI_COLORSPACE_RGB),
+					BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 					8,
 					&reject_connector_hdmi_funcs,
 					no_edid);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -2491,11 +2491,11 @@ static void drm_test_check_mode_valid_reject_max_clock(struct kunit *test)
 	struct drm_atomic_helper_connector_hdmi_priv *priv;
 	struct drm_connector *conn;
 	struct drm_display_mode *preferred;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				8,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_max_100mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -2538,11 +2538,11 @@ static void drm_test_check_infoframes(struct kunit *test)
 	struct drm_crtc *crtc;
 	int old_hdmi_update_failures;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				8,
 				&dummy_connector_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_max_200mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -2641,11 +2641,11 @@ static void drm_test_check_reject_avi_infoframe(struct kunit *test)
 	struct drm_crtc *crtc;
 	int old_hdmi_update_failures;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				8,
 				&reject_avi_infoframe_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_max_200mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -2745,11 +2745,11 @@ static void drm_test_check_reject_hdr_infoframe_bpc_8(struct kunit *test)
 	struct drm_crtc *crtc;
 	int old_hdmi_update_failures;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				8,
 				&reject_hdr_infoframe_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_max_200mhz_hdr);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -2859,11 +2859,11 @@ static void drm_test_check_reject_hdr_infoframe_bpc_10(struct kunit *test)
 	struct drm_property_blob *hdr_blob;
 	bool replaced;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				10,
 				&reject_hdr_infoframe_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_max_200mhz_hdr);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
@@ -2994,11 +2994,11 @@ static void drm_test_check_reject_audio_infoframe(struct kunit *test)
 	int old_hdmi_update_failures;
 	struct hdmi_audio_infoframe cea;
 	int ret;
 
 	priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test,
-				BIT(HDMI_COLORSPACE_RGB),
+				BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444),
 				8,
 				&reject_audio_infoframe_hdmi_funcs,
 				test_edid_hdmi_1080p_rgb_max_200mhz);
 	KUNIT_ASSERT_NOT_NULL(test, priv);
 
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 2ea31938168d73682724b312844fe2ba5a00d6d5..ceb09e133401bc67d1055fb99530207fbb7858c0 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -131,11 +131,11 @@ static bool vc4_hdmi_supports_scrambling(struct vc4_hdmi *vc4_hdmi)
 	return true;
 }
 
 static bool vc4_hdmi_mode_needs_scrambling(const struct drm_display_mode *mode,
 					   unsigned int bpc,
-					   enum hdmi_colorspace fmt)
+					   enum drm_output_color_format fmt)
 {
 	unsigned long long clock = drm_hdmi_compute_mode_clock(mode, bpc, fmt);
 
 	return clock > HDMI_14_MAX_TMDS_CLK;
 }
@@ -442,11 +442,11 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector)
 	if (!vc4->hvs->vc5_hdmi_enable_hdmi_20) {
 		struct drm_device *drm = connector->dev;
 		const struct drm_display_mode *mode;
 
 		list_for_each_entry(mode, &connector->probed_modes, head) {
-			if (vc4_hdmi_mode_needs_scrambling(mode, 8, HDMI_COLORSPACE_RGB)) {
+			if (vc4_hdmi_mode_needs_scrambling(mode, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444)) {
 				drm_warn_once(drm, "The core clock cannot reach frequencies high enough to support 4k @ 60Hz.");
 				drm_warn_once(drm, "Please change your config.txt file to add hdmi_enable_4kp60.");
 			}
 		}
 	}
@@ -545,13 +545,13 @@ static int vc4_hdmi_connector_init(struct drm_device *dev,
 				       "Broadcom", "Videocore",
 				       &vc4_hdmi_connector_funcs,
 				       &vc4_hdmi_hdmi_connector_funcs,
 				       DRM_MODE_CONNECTOR_HDMIA,
 				       vc4_hdmi->ddc,
-				       BIT(HDMI_COLORSPACE_RGB) |
-				       BIT(HDMI_COLORSPACE_YUV422) |
-				       BIT(HDMI_COLORSPACE_YUV444),
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) |
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) |
+				       BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444),
 				       max_bpc);
 	if (ret)
 		return ret;
 
 	ret = drm_connector_hdmi_audio_init(connector, dev->dev,
@@ -1212,17 +1212,17 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
 		return;
 
 	spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
 
 	switch (state->hdmi.output_format) {
-	case HDMI_COLORSPACE_YUV444:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR444:
 		csc = vc5_hdmi_find_yuv_csc_coeffs(vc4_hdmi, state->colorspace, !!lim_range);
 
 		vc5_hdmi_set_csc_coeffs_swap(vc4_hdmi, csc);
 		break;
 
-	case HDMI_COLORSPACE_YUV422:
+	case DRM_OUTPUT_COLOR_FORMAT_YCBCR422:
 		csc = vc5_hdmi_find_yuv_csc_coeffs(vc4_hdmi, state->colorspace, !!lim_range);
 
 		csc_ctl |= VC4_SET_FIELD(VC5_MT_CP_CSC_CTL_FILTER_MODE_444_TO_422_STANDARD,
 					 VC5_MT_CP_CSC_CTL_FILTER_MODE_444_TO_422) |
 			VC5_MT_CP_CSC_CTL_USE_444_TO_422 |
@@ -1235,11 +1235,11 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
 					VC5_DVP_HT_VEC_INTERFACE_CFG_SEL_422);
 
 		vc5_hdmi_set_csc_coeffs(vc4_hdmi, csc);
 		break;
 
-	case HDMI_COLORSPACE_RGB:
+	case DRM_OUTPUT_COLOR_FORMAT_RGB444:
 		if_xbar = 0x354021;
 
 		vc5_hdmi_set_csc_coeffs(vc4_hdmi, vc5_hdmi_csc_full_rgb_to_rgb[lim_range]);
 		break;
 
@@ -1392,11 +1392,11 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi,
 
 	/*
 	 * YCC422 is always 36-bit and not considered deep colour so
 	 * doesn't signal in GCP.
 	 */
-	if (state->hdmi.output_format == HDMI_COLORSPACE_YUV422) {
+	if (state->hdmi.output_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR422) {
 		gcp = 0;
 	}
 
 	reg = HDMI_READ(HDMI_DEEP_COLOR_CONFIG_1);
 	reg &= ~(VC5_HDMI_DEEP_COLOR_CONFIG_1_INIT_PACK_PHASE_MASK |
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h
index 8d069718df00d9afc13aadbb12648e2bb75a1721..29d461d4ee49fdee29edd6a102e70ded9067a64b 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.h
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
@@ -208,11 +208,11 @@ struct vc4_hdmi {
 	/**
 	 * @output_format: Copy of
 	 * @drm_connector_state.hdmi.output_format for use outside of
 	 * KMS hooks. Protected by @mutex.
 	 */
-	enum hdmi_colorspace output_format;
+	enum drm_output_color_format output_format;
 
 	/**
 	 * @hdmi_jack: Represents the connection state of the HDMI plug, for
 	 * ALSA jack detection.
 	 */
diff --git a/include/drm/display/drm_hdmi_helper.h b/include/drm/display/drm_hdmi_helper.h
index 09145c9ee9fc0cd839242f2373b305940e06e157..414e134ca23bcdcdd6ef491812ed0a9020b204ba 100644
--- a/include/drm/display/drm_hdmi_helper.h
+++ b/include/drm/display/drm_hdmi_helper.h
@@ -2,10 +2,11 @@
 
 #ifndef DRM_HDMI_HELPER
 #define DRM_HDMI_HELPER
 
 #include <linux/hdmi.h>
+#include <drm/drm_connector.h>
 
 struct drm_connector;
 struct drm_connector_state;
 struct drm_display_mode;
 
@@ -24,11 +25,11 @@ drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame,
 void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame,
 					 const struct drm_connector_state *conn_state);
 
 unsigned long long
 drm_hdmi_compute_mode_clock(const struct drm_display_mode *mode,
-			    unsigned int bpc, enum hdmi_colorspace fmt);
+			    unsigned int bpc, enum drm_output_color_format fmt);
 
 void
 drm_hdmi_acr_get_n_cts(unsigned long long tmds_char_rate,
 		       unsigned int sample_rate,
 		       unsigned int *out_n,
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index e97c8a209ef5c96ecf4bcb5f0b1b5f1bc0f35b3c..8d7b761c54c1da676afc2a8859b975be936806dc 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -400,12 +400,10 @@ enum drm_hdmi_broadcast_rgb {
 	DRM_HDMI_BROADCAST_RGB_LIMITED,
 };
 
 const char *
 drm_hdmi_connector_get_broadcast_rgb_name(enum drm_hdmi_broadcast_rgb broadcast_rgb);
-const char *
-drm_hdmi_connector_get_output_format_name(enum hdmi_colorspace fmt);
 
 /**
  * struct drm_monitor_range_info - Panel's Monitor range in EDID for
  * &drm_display_info
  *
@@ -579,10 +577,13 @@ enum drm_output_color_format {
 	DRM_OUTPUT_COLOR_FORMAT_YCBCR444,
 	DRM_OUTPUT_COLOR_FORMAT_YCBCR422,
 	DRM_OUTPUT_COLOR_FORMAT_YCBCR420,
 };
 
+const char *
+drm_hdmi_connector_get_output_format_name(enum drm_output_color_format fmt);
+
 /**
  * enum drm_bus_flags - bus_flags info for &drm_display_info
  *
  * This enum defines signal polarities and clock edge information for signals on
  * a bus as bitmask flags.
@@ -1010,11 +1011,11 @@ struct drm_connector_hdmi_state {
 	unsigned int output_bpc;
 
 	/**
 	 * @output_format: Pixel format to output in.
 	 */
-	enum hdmi_colorspace output_format;
+	enum drm_output_color_format output_format;
 
 	/**
 	 * @tmds_char_rate: TMDS Character Rate, in Hz.
 	 */
 	unsigned long long tmds_char_rate;

-- 
2.52.0


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

* Re: [PATCH 14/14] drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace
  2026-02-24 10:58 ` [PATCH 14/14] drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace Maxime Ripard
@ 2026-02-24 12:43   ` Jani Nikula
  2026-02-25 17:03   ` Nicolas Frattaroli
  2026-02-26 16:24   ` Nicolas Frattaroli
  2 siblings, 0 replies; 28+ messages in thread
From: Jani Nikula @ 2026-02-24 12:43 UTC (permalink / raw)
  To: Maxime Ripard, Nicolas Frattaroli, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher,
	Christian König, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Andy Yan,
	Liviu Dudau, Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

On Tue, 24 Feb 2026, Maxime Ripard <mripard@kernel.org> wrote:
> diff --git a/include/drm/display/drm_hdmi_helper.h b/include/drm/display/drm_hdmi_helper.h
> index 09145c9ee9fc0cd839242f2373b305940e06e157..414e134ca23bcdcdd6ef491812ed0a9020b204ba 100644
> --- a/include/drm/display/drm_hdmi_helper.h
> +++ b/include/drm/display/drm_hdmi_helper.h
> @@ -2,10 +2,11 @@
>  
>  #ifndef DRM_HDMI_HELPER
>  #define DRM_HDMI_HELPER
>  
>  #include <linux/hdmi.h>
> +#include <drm/drm_connector.h>

You could avoid the include by forward declaring the enum, which is not
strictly standard C but allowed by both GCC and Clang, and quite useful
in reducing header dependencies.

BR,
Jani.

>  
>  struct drm_connector;
>  struct drm_connector_state;
>  struct drm_display_mode;
>  
> @@ -24,11 +25,11 @@ drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame,
>  void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame,
>  					 const struct drm_connector_state *conn_state);
>  
>  unsigned long long
>  drm_hdmi_compute_mode_clock(const struct drm_display_mode *mode,
> -			    unsigned int bpc, enum hdmi_colorspace fmt);
> +			    unsigned int bpc, enum drm_output_color_format fmt);
>  
>  void
>  drm_hdmi_acr_get_n_cts(unsigned long long tmds_char_rate,
>  		       unsigned int sample_rate,
>  		       unsigned int *out_n,

-- 
Jani Nikula, Intel

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

* Re: [PATCH 00/14] drm: Create drm_output_color_format enum
  2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
                   ` (13 preceding siblings ...)
  2026-02-24 10:58 ` [PATCH 14/14] drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace Maxime Ripard
@ 2026-02-24 12:44 ` Jani Nikula
  14 siblings, 0 replies; 28+ messages in thread
From: Jani Nikula @ 2026-02-24 12:44 UTC (permalink / raw)
  To: Maxime Ripard, Nicolas Frattaroli, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher,
	Christian König, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Andy Yan,
	Liviu Dudau, Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

On Tue, 24 Feb 2026, Maxime Ripard <mripard@kernel.org> wrote:
> Hi,
>
> This series creates an enum to represent the output color format as an
> enum instead of a bitmask, and consolidate the HDMI helpers to use the
> new enum.
>
> This should make Nicolas' work easier.
>
> It has been build tested, and passes kunit tests.
>
> Let me know what you think,

I like this. I eyeballed through the series, but did not spend enough
time to call it detailed review.

Acked-by: Jani Nikula <jani.nikula@intel.com>


-- 
Jani Nikula, Intel

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

* Re: [PATCH 10/14] drm/arm: komeda: Convert to drm_output_color_format
  2026-02-24 10:58 ` [PATCH 10/14] drm/arm: komeda: " Maxime Ripard
@ 2026-02-25 16:12   ` Liviu Dudau
  0 siblings, 0 replies; 28+ messages in thread
From: Liviu Dudau @ 2026-02-25 16:12 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Chun-Kuang Hu,
	Philipp Zabel, Matthias Brugger, AngeloGioacchino Del Regno,
	Sandy Huang, Heiko Stübner, Liu Ying, Chen-Yu Tsai,
	Samuel Holland, Dave Stevenson, Maíra Canal,
	Raspberry Pi Kernel Maintenance, dri-devel, linux-kernel, amd-gfx,
	linux-mediatek, linux-arm-kernel, linux-rockchip, linux-sunxi

On Tue, Feb 24, 2026 at 11:58:49AM +0100, Maxime Ripard wrote:
> Now that we introduced a new drm_output_color_format enum to represent
> what DRM_COLOR_FORMAT_* bits were representing, we can switch to the new
> enum.
> 
> The main different is that while DRM_COLOR_FORMAT_ was a bitmask,
> drm_output_color_format is a proper enum. However, the enum was done is
> such a way than DRM_COLOR_FORMAT_X = BIT(DRM_OUTPUT_COLOR_FORMAT_X) so
> the transitition is easier.
> 
> The only thing we need to consider is if the original code meant to use
> that value as a bitmask, in which case we do need to keep the bit shift,
> or as a discriminant in which case we don't.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>

For the first patch in the series that introduces the enum and this one:

Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu

> ---
>  drivers/gpu/drm/arm/display/komeda/d71/d71_component.c     | 14 +++++++-------
>  drivers/gpu/drm/arm/display/komeda/komeda_crtc.c           |  2 +-
>  drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h       |  5 +++--
>  drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c |  2 +-
>  4 files changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c
> index 67e5d3b4190f62549bc8da700deb4b15e138b515..27ca2930cdac6e76a058102ea2c1d8306d85e751 100644
> --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c
> +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c
> @@ -1078,15 +1078,15 @@ static void d71_improc_update(struct komeda_component *c,
>  	}
>  
>  	mask |= IPS_CTRL_YUV | IPS_CTRL_CHD422 | IPS_CTRL_CHD420;
>  
>  	/* config color format */
> -	if (st->color_format == DRM_COLOR_FORMAT_YCBCR420)
> +	if (st->color_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR420)
>  		ctrl |= IPS_CTRL_YUV | IPS_CTRL_CHD422 | IPS_CTRL_CHD420;
> -	else if (st->color_format == DRM_COLOR_FORMAT_YCBCR422)
> +	else if (st->color_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR422)
>  		ctrl |= IPS_CTRL_YUV | IPS_CTRL_CHD422;
> -	else if (st->color_format == DRM_COLOR_FORMAT_YCBCR444)
> +	else if (st->color_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR444)
>  		ctrl |= IPS_CTRL_YUV;
>  
>  	malidp_write32_mask(reg, BLK_CONTROL, mask, ctrl);
>  }
>  
> @@ -1143,16 +1143,16 @@ static int d71_improc_init(struct d71_dev *d71,
>  		return PTR_ERR(c);
>  	}
>  
>  	improc = to_improc(c);
>  	improc->supported_color_depths = BIT(8) | BIT(10);
> -	improc->supported_color_formats = DRM_COLOR_FORMAT_RGB444 |
> -					  DRM_COLOR_FORMAT_YCBCR444 |
> -					  DRM_COLOR_FORMAT_YCBCR422;
> +	improc->supported_color_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) |
> +					  BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444) |
> +					  BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
>  	value = malidp_read32(reg, BLK_INFO);
>  	if (value & IPS_INFO_CHD420)
> -		improc->supported_color_formats |= DRM_COLOR_FORMAT_YCBCR420;
> +		improc->supported_color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
>  
>  	improc->supports_csc = true;
>  	improc->supports_gamma = true;
>  
>  	return 0;
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
> index 5a66948ffd24343cfc144e9b500679fd0c6bf43b..e78604469ef74800a4cac1e854821578b7e7bce8 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
> @@ -38,11 +38,11 @@ void komeda_crtc_get_color_config(struct drm_crtc_state *crtc_st,
>  			min_bpc = conn_bpc;
>  	}
>  
>  	/* connector doesn't config any color_format, use RGB444 as default */
>  	if (!conn_color_formats)
> -		conn_color_formats = DRM_COLOR_FORMAT_RGB444;
> +		conn_color_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444);
>  
>  	*color_depths = GENMASK(min_bpc, 0);
>  	*color_formats = conn_color_formats;
>  }
>  
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
> index ac8725e248537e5737d16cd36860401c42073500..dbe93894b2f6a193e24963d497ebb7b717ce3ebb 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
> @@ -315,20 +315,21 @@ struct komeda_splitter_state {
>  	u16 overlap;
>  };
>  
>  struct komeda_improc {
>  	struct komeda_component base;
> -	u32 supported_color_formats;  /* DRM_RGB/YUV444/YUV420*/
> +	u32 supported_color_formats;  /* BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444/YUV444/YUV420) */
>  	u32 supported_color_depths; /* BIT(8) | BIT(10)*/
>  	u8 supports_degamma : 1;
>  	u8 supports_csc : 1;
>  	u8 supports_gamma : 1;
>  };
>  
>  struct komeda_improc_state {
>  	struct komeda_component_state base;
> -	u8 color_format, color_depth;
> +	enum drm_output_color_format color_format;
> +	u8 color_depth;
>  	u16 hsize, vsize;
>  	u32 fgamma_coeffs[KOMEDA_N_GAMMA_COEFFS];
>  	u32 ctm_coeffs[KOMEDA_N_CTM_COEFFS];
>  };
>  
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
> index f4e76b46ca327a1c5db9bdbdd9550b45190b30d8..6f9b10cc831ff748296b9ed30b6de398c90c4786 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
> @@ -797,11 +797,11 @@ komeda_improc_validate(struct komeda_improc *improc,
>  					 improc->supported_color_formats);
>  			return -EINVAL;
>  		}
>  
>  		st->color_depth = __fls(avail_depths);
> -		st->color_format = BIT(__ffs(avail_formats));
> +		st->color_format = __ffs(avail_formats);
>  	}
>  
>  	if (kcrtc_st->base.color_mgmt_changed) {
>  		drm_lut_to_fgamma_coeffs(kcrtc_st->base.gamma_lut,
>  					 st->fgamma_coeffs);
> 
> -- 
> 2.52.0
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

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

* Re: [PATCH 14/14] drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace
  2026-02-24 10:58 ` [PATCH 14/14] drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace Maxime Ripard
  2026-02-24 12:43   ` Jani Nikula
@ 2026-02-25 17:03   ` Nicolas Frattaroli
  2026-02-25 17:21     ` Nicolas Frattaroli
  2026-02-26 16:24   ` Nicolas Frattaroli
  2 siblings, 1 reply; 28+ messages in thread
From: Nicolas Frattaroli @ 2026-02-25 17:03 UTC (permalink / raw)
  To: Jani Nikula, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, Harry Wentland, Leo Li,
	Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance, Maxime Ripard
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

On Tuesday, 24 February 2026 11:58:53 Central European Standard Time Maxime Ripard wrote:
> The hdmi_colorspace enum was defined to represent the colorspace value
> of the HDMI infoframes. It was later used by some HDMI drivers to
> express the output format they should be setting up.
> 
> During the introduction of the HDMI helpers, it then was used to
> represent it in the drm_connector_hdmi_state structure.
> 
> However, it's always been somewhat redundant with the DRM_COLOR_FORMAT_*
> defines, and now with the drm_output_color_format enum. Let's
> consolidate around drm_output_color_format in drm_connector_hdmi_state
> to facilitate the current effort to provide a global output format
> selection mechanism.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
>  drivers/gpu/drm/bridge/inno-hdmi.c                 |   6 +-
>  drivers/gpu/drm/bridge/ite-it6263.c                |   2 +-
>  drivers/gpu/drm/display/drm_hdmi_helper.c          |   7 +-
>  drivers/gpu/drm/display/drm_hdmi_state_helper.c    |  52 ++++--
>  drivers/gpu/drm/drm_bridge.c                       |   2 +-
>  drivers/gpu/drm/drm_connector.c                    |  14 +-
>  drivers/gpu/drm/mediatek/mtk_hdmi_v2.c             |   8 +-
>  drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c             |   2 +-
>  drivers/gpu/drm/tests/drm_connector_test.c         |  80 ++++-----
>  drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 182 ++++++++++-----------
>  drivers/gpu/drm/vc4/vc4_hdmi.c                     |  18 +-
>  drivers/gpu/drm/vc4/vc4_hdmi.h                     |   2 +-
>  include/drm/display/drm_hdmi_helper.h              |   3 +-
>  include/drm/drm_connector.h                        |   7 +-
>  14 files changed, 205 insertions(+), 180 deletions(-)
> 
> [... snip ...]
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 4f5b27fab475c7c733622eb8727927571f3fb8fe..171cd495976a3e16f201fd339d3d42a09dc3b63f 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> [... snip ...]
>  
> @@ -1424,25 +1424,25 @@ drm_hdmi_connector_get_broadcast_rgb_name(enum drm_hdmi_broadcast_rgb broadcast_
>  	return broadcast_rgb_names[broadcast_rgb].name;
>  }
>  EXPORT_SYMBOL(drm_hdmi_connector_get_broadcast_rgb_name);
>  
>  static const char * const output_format_str[] = {
> -	[HDMI_COLORSPACE_RGB]		= "RGB",
> -	[HDMI_COLORSPACE_YUV420]	= "YUV 4:2:0",
> -	[HDMI_COLORSPACE_YUV422]	= "YUV 4:2:2",
> -	[HDMI_COLORSPACE_YUV444]	= "YUV 4:4:4",
> +	[DRM_OUTPUT_COLOR_FORMAT_RGB444]	= "RGB",
> +	[DRM_OUTPUT_COLOR_FORMAT_YCBCR420]	= "YUV 4:2:0",
> +	[DRM_OUTPUT_COLOR_FORMAT_YCBCR422]	= "YUV 4:2:2",
> +	[DRM_OUTPUT_COLOR_FORMAT_YCBCR444]	= "YUV 4:4:4",
>  };
>  
>  /*
>   * drm_hdmi_connector_get_output_format_name() - Return a string for HDMI connector output format
>   * @fmt: Output format to compute name of
>   *
>   * Returns: the name of the output format, or NULL if the type is not
>   * valid.
>   */
>  const char *
> -drm_hdmi_connector_get_output_format_name(enum hdmi_colorspace fmt)
> +drm_hdmi_connector_get_output_format_name(enum drm_output_color_format fmt)
>  {
>  	if (fmt >= ARRAY_SIZE(output_format_str))
>  		return NULL;

Almost unrelated nit: we might want to also `fmt < 0 ||` here, since the
base type of enums is a signed int. I almost caught myself using this function
as a way to quickly check if a supplied color format property from userspace
was valid, which would've had some unpleasant consequences for the kernel's
memory.

Alternatively, I make my own switch-case based "is this a valid enum value"
function. I probably should do that actually, but my laziness lead me to
make sure we only have a single source of truth of what counts as a valid
enum value.

>  
>  	return output_format_str[fmt];
> [... snip ...]

Thanks for your work on this series, I was afraid of getting rid of
DRM_COLOR_FORMAT_* myself because I suspected it was going to be a
fairly large refactor across every driver. Guess I was both right
and wrong: it touches many files, but all the replacements are
fairly simple. :)

Kind regards,
Nicolas Frattaroli



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

* Re: [PATCH 14/14] drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace
  2026-02-25 17:03   ` Nicolas Frattaroli
@ 2026-02-25 17:21     ` Nicolas Frattaroli
  0 siblings, 0 replies; 28+ messages in thread
From: Nicolas Frattaroli @ 2026-02-25 17:21 UTC (permalink / raw)
  To: Jani Nikula, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, Harry Wentland, Leo Li,
	Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance, Maxime Ripard
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

On Wednesday, 25 February 2026 18:03:00 Central European Standard Time Nicolas Frattaroli wrote:
> On Tuesday, 24 February 2026 11:58:53 Central European Standard Time Maxime Ripard wrote:
> > The hdmi_colorspace enum was defined to represent the colorspace value
> > of the HDMI infoframes. It was later used by some HDMI drivers to
> > express the output format they should be setting up.
> > 
> > During the introduction of the HDMI helpers, it then was used to
> > represent it in the drm_connector_hdmi_state structure.
> > 
> > However, it's always been somewhat redundant with the DRM_COLOR_FORMAT_*
> > defines, and now with the drm_output_color_format enum. Let's
> > consolidate around drm_output_color_format in drm_connector_hdmi_state
> > to facilitate the current effort to provide a global output format
> > selection mechanism.
> > 
> > Signed-off-by: Maxime Ripard <mripard@kernel.org>
> > ---
> >  drivers/gpu/drm/bridge/inno-hdmi.c                 |   6 +-
> >  drivers/gpu/drm/bridge/ite-it6263.c                |   2 +-
> >  drivers/gpu/drm/display/drm_hdmi_helper.c          |   7 +-
> >  drivers/gpu/drm/display/drm_hdmi_state_helper.c    |  52 ++++--
> >  drivers/gpu/drm/drm_bridge.c                       |   2 +-
> >  drivers/gpu/drm/drm_connector.c                    |  14 +-
> >  drivers/gpu/drm/mediatek/mtk_hdmi_v2.c             |   8 +-
> >  drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c             |   2 +-
> >  drivers/gpu/drm/tests/drm_connector_test.c         |  80 ++++-----
> >  drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 182 ++++++++++-----------
> >  drivers/gpu/drm/vc4/vc4_hdmi.c                     |  18 +-
> >  drivers/gpu/drm/vc4/vc4_hdmi.h                     |   2 +-
> >  include/drm/display/drm_hdmi_helper.h              |   3 +-
> >  include/drm/drm_connector.h                        |   7 +-
> >  14 files changed, 205 insertions(+), 180 deletions(-)
> > 
> > [... snip ...]
> >
> > diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> > index 4f5b27fab475c7c733622eb8727927571f3fb8fe..171cd495976a3e16f201fd339d3d42a09dc3b63f 100644
> > --- a/drivers/gpu/drm/drm_connector.c
> > +++ b/drivers/gpu/drm/drm_connector.c
> > [... snip ...]
> >  
> > @@ -1424,25 +1424,25 @@ drm_hdmi_connector_get_broadcast_rgb_name(enum drm_hdmi_broadcast_rgb broadcast_
> >  	return broadcast_rgb_names[broadcast_rgb].name;
> >  }
> >  EXPORT_SYMBOL(drm_hdmi_connector_get_broadcast_rgb_name);
> >  
> >  static const char * const output_format_str[] = {
> > -	[HDMI_COLORSPACE_RGB]		= "RGB",
> > -	[HDMI_COLORSPACE_YUV420]	= "YUV 4:2:0",
> > -	[HDMI_COLORSPACE_YUV422]	= "YUV 4:2:2",
> > -	[HDMI_COLORSPACE_YUV444]	= "YUV 4:4:4",
> > +	[DRM_OUTPUT_COLOR_FORMAT_RGB444]	= "RGB",
> > +	[DRM_OUTPUT_COLOR_FORMAT_YCBCR420]	= "YUV 4:2:0",
> > +	[DRM_OUTPUT_COLOR_FORMAT_YCBCR422]	= "YUV 4:2:2",
> > +	[DRM_OUTPUT_COLOR_FORMAT_YCBCR444]	= "YUV 4:4:4",
> >  };
> >  
> >  /*
> >   * drm_hdmi_connector_get_output_format_name() - Return a string for HDMI connector output format
> >   * @fmt: Output format to compute name of
> >   *
> >   * Returns: the name of the output format, or NULL if the type is not
> >   * valid.
> >   */
> >  const char *
> > -drm_hdmi_connector_get_output_format_name(enum hdmi_colorspace fmt)
> > +drm_hdmi_connector_get_output_format_name(enum drm_output_color_format fmt)
> >  {
> >  	if (fmt >= ARRAY_SIZE(output_format_str))
> >  		return NULL;
> 
> Almost unrelated nit: we might want to also `fmt < 0 ||` here, since the
> base type of enums is a signed int. I almost caught myself using this function
> as a way to quickly check if a supplied color format property from userspace
> was valid, which would've had some unpleasant consequences for the kernel's
> memory.
> 
> Alternatively, I make my own switch-case based "is this a valid enum value"
> function. I probably should do that actually, but my laziness lead me to
> make sure we only have a single source of truth of what counts as a valid
> enum value.

Gah, disregard this, I just realised that this enum shouldn't be used as
the one in the property anyway, because of AUTO, as you already pointed out
in your reply to my series as well.

> 
> >  
> >  	return output_format_str[fmt];
> > [... snip ...]
> 
> Thanks for your work on this series, I was afraid of getting rid of
> DRM_COLOR_FORMAT_* myself because I suspected it was going to be a
> fairly large refactor across every driver. Guess I was both right
> and wrong: it touches many files, but all the replacements are
> fairly simple. :)
> 
> Kind regards,
> Nicolas Frattaroli





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

* Re: [PATCH 11/14] drm/mediatek: dp: Convert to drm_output_color_format
  2026-02-24 10:58 ` [PATCH 11/14] drm/mediatek: dp: " Maxime Ripard
@ 2026-02-26  8:58   ` Philipp Zabel
  0 siblings, 0 replies; 28+ messages in thread
From: Philipp Zabel @ 2026-02-26  8:58 UTC (permalink / raw)
  To: Maxime Ripard, Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Matthias Brugger, AngeloGioacchino Del Regno,
	Sandy Huang, Heiko Stübner, Liu Ying, Chen-Yu Tsai,
	Samuel Holland, Dave Stevenson, Maíra Canal,
	Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

On Di, 2026-02-24 at 11:58 +0100, Maxime Ripard wrote:
> Now that we introduced a new drm_output_color_format enum to represent
> what DRM_COLOR_FORMAT_* bits were representing, we can switch to the new
> enum.
> 
> The main different is that while DRM_COLOR_FORMAT_ was a bitmask,

s/different/difference/

> drm_output_color_format is a proper enum. However, the enum was done is
> such a way than DRM_COLOR_FORMAT_X = BIT(DRM_OUTPUT_COLOR_FORMAT_X) so
> the transitition is easier.
> 
> The only thing we need to consider is if the original code meant to use
> that value as a bitmask, in which case we do need to keep the bit shift,
> or as a discriminant in which case we don't.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH 09/14] drm/bridge: synopsys: dw-hdmi: Convert to drm_output_color_format
  2026-02-24 10:58 ` [PATCH 09/14] drm/bridge: synopsys: dw-hdmi: " Maxime Ripard
@ 2026-02-26  8:59   ` Philipp Zabel
  0 siblings, 0 replies; 28+ messages in thread
From: Philipp Zabel @ 2026-02-26  8:59 UTC (permalink / raw)
  To: Maxime Ripard, Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Matthias Brugger, AngeloGioacchino Del Regno,
	Sandy Huang, Heiko Stübner, Liu Ying, Chen-Yu Tsai,
	Samuel Holland, Dave Stevenson, Maíra Canal,
	Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

On Di, 2026-02-24 at 11:58 +0100, Maxime Ripard wrote:
> Now that we introduced a new drm_output_color_format enum to represent
> what DRM_COLOR_FORMAT_* bits were representing, we can switch to the new
> enum.
> 
> The main different is that while DRM_COLOR_FORMAT_ was a bitmask,
> drm_output_color_format is a proper enum. However, the enum was done is
> such a way than DRM_COLOR_FORMAT_X = BIT(DRM_OUTPUT_COLOR_FORMAT_X) so
> the transitition is easier.
> 
> The only thing we need to consider is if the original code meant to use
> that value as a bitmask, in which case we do need to keep the bit shift,
> or as a discriminant in which case we don't.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH 01/14] drm/connector: Introduce drm_output_color_format enum
  2026-02-24 10:58 ` [PATCH 01/14] drm/connector: Introduce " Maxime Ripard
@ 2026-02-26  9:12   ` Philipp Zabel
  2026-02-27  8:38     ` Maxime Ripard
  0 siblings, 1 reply; 28+ messages in thread
From: Philipp Zabel @ 2026-02-26  9:12 UTC (permalink / raw)
  To: Maxime Ripard, Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Matthias Brugger, AngeloGioacchino Del Regno,
	Sandy Huang, Heiko Stübner, Liu Ying, Chen-Yu Tsai,
	Samuel Holland, Dave Stevenson, Maíra Canal,
	Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

On Di, 2026-02-24 at 11:58 +0100, Maxime Ripard wrote:
> The EDID parsing code initially introduced the DRM_COLOR_FORMAT_*
> defines to represent the sink capabilities. Since a given sink could
> support multiple formats, it was first defined as a bitmask.
> 
> However, the core and drivers have since leveraged those defines to
> represent both the supported formats but also the current format being
> used.
> 
> Considering the latter case, the more natural, and consistent, thing to
> do would be to create an enum of all the possible formats, and then list
> the supported formats using a bitmask of the individual enum values.
> 
> Let's create a new enum following that pattern, drm_output_color_format,
> while maintaining the DRM_COLOR_FORMAT_* compatibility to make the
> transition easier.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
>  include/drm/drm_connector.h | 42 ++++++++++++++++++++++++++++++++++--------
>  1 file changed, 34 insertions(+), 8 deletions(-)
> 
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 7eaec37ae1c735334afa7dad15a38cf0c8b761b8..c67539708f636ae3905bb8424c63799bd1811f28 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -554,10 +554,35 @@ enum drm_colorspace {
>  	DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT	= 14,
>  	DRM_MODE_COLORIMETRY_BT601_YCC		= 15,
>  	DRM_MODE_COLORIMETRY_COUNT
>  };
>  
> +/**
> + * enum drm_output_color_format - Output Color Format
> + *
> + * This enum is a consolidated color format list supported by
> + * connectors. It's only ever really been used for HDMI and DP so far,
> + * so it's not exhaustive and can be extended to represent other formats
> + * in the future.
> + *
> + *
> + * @DRM_OUTPUT_COLOR_FORMAT_RGB444:
> + *   RGB output format
> + * @DRM_OUTPUT_COLOR_FORMAT_YCBCR444:
> + *   YCbCr 4:4:4 output format (ie. not subsampled)
> + * @DRM_OUTPUT_COLOR_FORMAT_YCBCR422:
> + *   YCbCr 4:2:2 output format (ie. with horizontal subsampling)
> + * @DRM_OUTPUT_COLOR_FORMAT_YCBCR420:
> + *   YCbCr 4:2:0 output format (ie. with horizontal and vertical subsampling)
> + */
> +enum drm_output_color_format {
> +	DRM_OUTPUT_COLOR_FORMAT_RGB444 = 0,
> +	DRM_OUTPUT_COLOR_FORMAT_YCBCR444,
> +	DRM_OUTPUT_COLOR_FORMAT_YCBCR422,
> +	DRM_OUTPUT_COLOR_FORMAT_YCBCR420,
> +};
> +
>  /**
>   * enum drm_bus_flags - bus_flags info for &drm_display_info
>   *
>   * This enum defines signal polarities and clock edge information for signals on
>   * a bus as bitmask flags.
> @@ -697,14 +722,14 @@ struct drm_display_info {
>  	/**
>  	 * @subpixel_order: Subpixel order of LCD panels.
>  	 */
>  	enum subpixel_order subpixel_order;
>  
> -#define DRM_COLOR_FORMAT_RGB444		(1<<0)
> -#define DRM_COLOR_FORMAT_YCBCR444	(1<<1)
> -#define DRM_COLOR_FORMAT_YCBCR422	(1<<2)
> -#define DRM_COLOR_FORMAT_YCBCR420	(1<<3)
> +#define DRM_COLOR_FORMAT_RGB444		(1 << DRM_OUTPUT_COLOR_FORMAT_RGB444)
> +#define DRM_COLOR_FORMAT_YCBCR444	(1 << DRM_OUTPUT_COLOR_FORMAT_YCBCR444)
> +#define DRM_COLOR_FORMAT_YCBCR422	(1 << DRM_OUTPUT_COLOR_FORMAT_YCBCR422)
> +#define DRM_COLOR_FORMAT_YCBCR420	(1 << DRM_OUTPUT_COLOR_FORMAT_YCBCR420)

Can we move this? Either up, directly after drm_output_color_format, or
down, directly before color_formats.

I think 8d70f395e6cb ("drm: Add support for a panel-orientation
connector property, v6") didn't separate the two on purpose.

>  	/**
>  	 * @panel_orientation: Read only connector property for built-in panels,
>  	 * indicating the orientation of the panel vs the device's casing.
>  	 * drm_connector_init() sets this to DRM_MODE_PANEL_ORIENTATION_UNKNOWN.
> @@ -712,14 +737,15 @@ struct drm_display_info {
>  	 * fb to compensate and gets exported as prop to userspace.
>  	 */
>  	int panel_orientation;
>  
>  	/**
> -	 * @color_formats: HDMI Color formats, selects between RGB and YCrCb
> -	 * modes. Used DRM_COLOR_FORMAT\_ defines, which are _not_ the same ones
> -	 * as used to describe the pixel format in framebuffers, and also don't
> -	 * match the formats in @bus_formats which are shared with v4l.
> +	 * @color_formats: HDMI Color formats, selects between RGB and
> +	 * YCrCb modes. Uses a bitmask of DRM_OUTPUT_COLOR_FORMAT\_

Maybe s/YCrCb/YCbCr/ for consistency?

> +	 * defines, which are _not_ the same ones as used to describe
> +	 * the pixel format in framebuffers, and also don't match the
> +	 * formats in @bus_formats which are shared with v4l.
>  	 */
>  	u32 color_formats;
>  
>  	/**
>  	 * @bus_formats: Pixel data format on the wire, somewhat redundant with

regards
Philipp

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

* Re: [PATCH 14/14] drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace
  2026-02-24 10:58 ` [PATCH 14/14] drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace Maxime Ripard
  2026-02-24 12:43   ` Jani Nikula
  2026-02-25 17:03   ` Nicolas Frattaroli
@ 2026-02-26 16:24   ` Nicolas Frattaroli
  2026-02-27  8:29     ` Maxime Ripard
  2 siblings, 1 reply; 28+ messages in thread
From: Nicolas Frattaroli @ 2026-02-26 16:24 UTC (permalink / raw)
  To: Jani Nikula, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, Harry Wentland, Leo Li,
	Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Philipp Zabel, Matthias Brugger,
	AngeloGioacchino Del Regno, Sandy Huang, Heiko Stübner,
	Liu Ying, Chen-Yu Tsai, Samuel Holland, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance, Maxime Ripard
  Cc: dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

On Tuesday, 24 February 2026 11:58:53 Central European Standard Time Maxime Ripard wrote:
> The hdmi_colorspace enum was defined to represent the colorspace value
> of the HDMI infoframes. It was later used by some HDMI drivers to
> express the output format they should be setting up.
> 
> During the introduction of the HDMI helpers, it then was used to
> represent it in the drm_connector_hdmi_state structure.
> 
> However, it's always been somewhat redundant with the DRM_COLOR_FORMAT_*
> defines, and now with the drm_output_color_format enum. Let's
> consolidate around drm_output_color_format in drm_connector_hdmi_state
> to facilitate the current effort to provide a global output format
> selection mechanism.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
>  drivers/gpu/drm/bridge/inno-hdmi.c                 |   6 +-
>  drivers/gpu/drm/bridge/ite-it6263.c                |   2 +-
>  drivers/gpu/drm/display/drm_hdmi_helper.c          |   7 +-
>  drivers/gpu/drm/display/drm_hdmi_state_helper.c    |  52 ++++--
>  drivers/gpu/drm/drm_bridge.c                       |   2 +-
>  drivers/gpu/drm/drm_connector.c                    |  14 +-
>  drivers/gpu/drm/mediatek/mtk_hdmi_v2.c             |   8 +-
>  drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c             |   2 +-
>  drivers/gpu/drm/tests/drm_connector_test.c         |  80 ++++-----
>  drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 182 ++++++++++-----------
>  drivers/gpu/drm/vc4/vc4_hdmi.c                     |  18 +-
>  drivers/gpu/drm/vc4/vc4_hdmi.h                     |   2 +-
>  include/drm/display/drm_hdmi_helper.h              |   3 +-
>  include/drm/drm_connector.h                        |   7 +-
>  14 files changed, 205 insertions(+), 180 deletions(-)
> 
> [... snip ...]
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 4f5b27fab475c7c733622eb8727927571f3fb8fe..171cd495976a3e16f201fd339d3d42a09dc3b63f 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -589,14 +589,14 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
>  
>  	if (!(connector_type == DRM_MODE_CONNECTOR_HDMIA ||
>  	      connector_type == DRM_MODE_CONNECTOR_HDMIB))
>  		return -EINVAL;
>  
> -	if (!supported_formats || !(supported_formats & BIT(HDMI_COLORSPACE_RGB)))
> +	if (!supported_formats || !(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444)))
>  		return -EINVAL;
>  
> -	if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(HDMI_COLORSPACE_YUV420)))
> +	if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)))
>  		return -EINVAL;

I don't think this will work as-is. drm_bridge_connector_init calls this
function assuming hdmi_colorspace bitmasks in supported_formats.

This may have slipped through the conversion; the synopsys dw-hdmi-qp core
(separate from synopsys dw-hdmi) also assumes hdmi_colorspace, see e.g.
dw_hdmi_qp_plat_data::supported_formats in include/drm/bridge/dw_hdmi_qp.h

So should be a simple fix I hope.

>  
>  	if (!(max_bpc == 8 || max_bpc == 10 || max_bpc == 12))
>  		return -EINVAL;
>  
> [... snip ...]

Kind regards,
Nicolas Frattaroli





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

* Re: [PATCH 14/14] drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace
  2026-02-26 16:24   ` Nicolas Frattaroli
@ 2026-02-27  8:29     ` Maxime Ripard
  2026-02-27 12:46       ` Nicolas Frattaroli
  0 siblings, 1 reply; 28+ messages in thread
From: Maxime Ripard @ 2026-02-27  8:29 UTC (permalink / raw)
  To: Nicolas Frattaroli
  Cc: Jani Nikula, Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Simona Vetter, Harry Wentland, Leo Li, Rodrigo Siqueira,
	Alex Deucher, Christian König, Andrzej Hajda, Neil Armstrong,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Andy Yan, Liviu Dudau, Chun-Kuang Hu, Philipp Zabel,
	Matthias Brugger, AngeloGioacchino Del Regno, Sandy Huang,
	Heiko Stübner, Liu Ying, Chen-Yu Tsai, Samuel Holland,
	Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
	dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

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

Hi

On Thu, Feb 26, 2026 at 05:24:05PM +0100, Nicolas Frattaroli wrote:
> On Tuesday, 24 February 2026 11:58:53 Central European Standard Time Maxime Ripard wrote:
> > The hdmi_colorspace enum was defined to represent the colorspace value
> > of the HDMI infoframes. It was later used by some HDMI drivers to
> > express the output format they should be setting up.
> > 
> > During the introduction of the HDMI helpers, it then was used to
> > represent it in the drm_connector_hdmi_state structure.
> > 
> > However, it's always been somewhat redundant with the DRM_COLOR_FORMAT_*
> > defines, and now with the drm_output_color_format enum. Let's
> > consolidate around drm_output_color_format in drm_connector_hdmi_state
> > to facilitate the current effort to provide a global output format
> > selection mechanism.
> > 
> > Signed-off-by: Maxime Ripard <mripard@kernel.org>
> > ---
> >  drivers/gpu/drm/bridge/inno-hdmi.c                 |   6 +-
> >  drivers/gpu/drm/bridge/ite-it6263.c                |   2 +-
> >  drivers/gpu/drm/display/drm_hdmi_helper.c          |   7 +-
> >  drivers/gpu/drm/display/drm_hdmi_state_helper.c    |  52 ++++--
> >  drivers/gpu/drm/drm_bridge.c                       |   2 +-
> >  drivers/gpu/drm/drm_connector.c                    |  14 +-
> >  drivers/gpu/drm/mediatek/mtk_hdmi_v2.c             |   8 +-
> >  drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c             |   2 +-
> >  drivers/gpu/drm/tests/drm_connector_test.c         |  80 ++++-----
> >  drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 182 ++++++++++-----------
> >  drivers/gpu/drm/vc4/vc4_hdmi.c                     |  18 +-
> >  drivers/gpu/drm/vc4/vc4_hdmi.h                     |   2 +-
> >  include/drm/display/drm_hdmi_helper.h              |   3 +-
> >  include/drm/drm_connector.h                        |   7 +-
> >  14 files changed, 205 insertions(+), 180 deletions(-)
> > 
> > [... snip ...]
> > diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> > index 4f5b27fab475c7c733622eb8727927571f3fb8fe..171cd495976a3e16f201fd339d3d42a09dc3b63f 100644
> > --- a/drivers/gpu/drm/drm_connector.c
> > +++ b/drivers/gpu/drm/drm_connector.c
> > @@ -589,14 +589,14 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
> >  
> >  	if (!(connector_type == DRM_MODE_CONNECTOR_HDMIA ||
> >  	      connector_type == DRM_MODE_CONNECTOR_HDMIB))
> >  		return -EINVAL;
> >  
> > -	if (!supported_formats || !(supported_formats & BIT(HDMI_COLORSPACE_RGB)))
> > +	if (!supported_formats || !(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444)))
> >  		return -EINVAL;
> >  
> > -	if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(HDMI_COLORSPACE_YUV420)))
> > +	if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)))
> >  		return -EINVAL;
> 
> I don't think this will work as-is. drm_bridge_connector_init calls this
> function assuming hdmi_colorspace bitmasks in supported_formats.

Yeah, you're right I missed the conversion in drm_bridge_connector_init.
It should be fixed now.

> This may have slipped through the conversion; the synopsys dw-hdmi-qp core
> (separate from synopsys dw-hdmi) also assumes hdmi_colorspace, see e.g.
> dw_hdmi_qp_plat_data::supported_formats in include/drm/bridge/dw_hdmi_qp.h
> 
> So should be a simple fix I hope.

For this one, did you identify anything more than the comment in
dw_hdmi_qp_plat_data? I couldn't find any user of HDMI_COLORSPACE_* left
for the dw_hdmi_qp_plat_data.supported_formats users.

Maxime

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

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

* Re: [PATCH 01/14] drm/connector: Introduce drm_output_color_format enum
  2026-02-26  9:12   ` Philipp Zabel
@ 2026-02-27  8:38     ` Maxime Ripard
  2026-02-27 15:10       ` Philipp Zabel
  0 siblings, 1 reply; 28+ messages in thread
From: Maxime Ripard @ 2026-02-27  8:38 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Matthias Brugger, AngeloGioacchino Del Regno,
	Sandy Huang, Heiko Stübner, Liu Ying, Chen-Yu Tsai,
	Samuel Holland, Dave Stevenson, Maíra Canal,
	Raspberry Pi Kernel Maintenance, dri-devel, linux-kernel, amd-gfx,
	linux-mediatek, linux-arm-kernel, linux-rockchip, linux-sunxi

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

Hi Philipp

On Thu, Feb 26, 2026 at 10:12:02AM +0100, Philipp Zabel wrote:
> On Di, 2026-02-24 at 11:58 +0100, Maxime Ripard wrote:
> > The EDID parsing code initially introduced the DRM_COLOR_FORMAT_*
> > defines to represent the sink capabilities. Since a given sink could
> > support multiple formats, it was first defined as a bitmask.
> > 
> > However, the core and drivers have since leveraged those defines to
> > represent both the supported formats but also the current format being
> > used.
> > 
> > Considering the latter case, the more natural, and consistent, thing to
> > do would be to create an enum of all the possible formats, and then list
> > the supported formats using a bitmask of the individual enum values.
> > 
> > Let's create a new enum following that pattern, drm_output_color_format,
> > while maintaining the DRM_COLOR_FORMAT_* compatibility to make the
> > transition easier.
> > 
> > Signed-off-by: Maxime Ripard <mripard@kernel.org>
> > ---
> >  include/drm/drm_connector.h | 42 ++++++++++++++++++++++++++++++++++--------
> >  1 file changed, 34 insertions(+), 8 deletions(-)
> > 
> > diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> > index 7eaec37ae1c735334afa7dad15a38cf0c8b761b8..c67539708f636ae3905bb8424c63799bd1811f28 100644
> > --- a/include/drm/drm_connector.h
> > +++ b/include/drm/drm_connector.h
> > @@ -554,10 +554,35 @@ enum drm_colorspace {
> >  	DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT	= 14,
> >  	DRM_MODE_COLORIMETRY_BT601_YCC		= 15,
> >  	DRM_MODE_COLORIMETRY_COUNT
> >  };
> >  
> > +/**
> > + * enum drm_output_color_format - Output Color Format
> > + *
> > + * This enum is a consolidated color format list supported by
> > + * connectors. It's only ever really been used for HDMI and DP so far,
> > + * so it's not exhaustive and can be extended to represent other formats
> > + * in the future.
> > + *
> > + *
> > + * @DRM_OUTPUT_COLOR_FORMAT_RGB444:
> > + *   RGB output format
> > + * @DRM_OUTPUT_COLOR_FORMAT_YCBCR444:
> > + *   YCbCr 4:4:4 output format (ie. not subsampled)
> > + * @DRM_OUTPUT_COLOR_FORMAT_YCBCR422:
> > + *   YCbCr 4:2:2 output format (ie. with horizontal subsampling)
> > + * @DRM_OUTPUT_COLOR_FORMAT_YCBCR420:
> > + *   YCbCr 4:2:0 output format (ie. with horizontal and vertical subsampling)
> > + */
> > +enum drm_output_color_format {
> > +	DRM_OUTPUT_COLOR_FORMAT_RGB444 = 0,
> > +	DRM_OUTPUT_COLOR_FORMAT_YCBCR444,
> > +	DRM_OUTPUT_COLOR_FORMAT_YCBCR422,
> > +	DRM_OUTPUT_COLOR_FORMAT_YCBCR420,
> > +};
> > +
> >  /**
> >   * enum drm_bus_flags - bus_flags info for &drm_display_info
> >   *
> >   * This enum defines signal polarities and clock edge information for signals on
> >   * a bus as bitmask flags.
> > @@ -697,14 +722,14 @@ struct drm_display_info {
> >  	/**
> >  	 * @subpixel_order: Subpixel order of LCD panels.
> >  	 */
> >  	enum subpixel_order subpixel_order;
> >  
> > -#define DRM_COLOR_FORMAT_RGB444		(1<<0)
> > -#define DRM_COLOR_FORMAT_YCBCR444	(1<<1)
> > -#define DRM_COLOR_FORMAT_YCBCR422	(1<<2)
> > -#define DRM_COLOR_FORMAT_YCBCR420	(1<<3)
> > +#define DRM_COLOR_FORMAT_RGB444		(1 << DRM_OUTPUT_COLOR_FORMAT_RGB444)
> > +#define DRM_COLOR_FORMAT_YCBCR444	(1 << DRM_OUTPUT_COLOR_FORMAT_YCBCR444)
> > +#define DRM_COLOR_FORMAT_YCBCR422	(1 << DRM_OUTPUT_COLOR_FORMAT_YCBCR422)
> > +#define DRM_COLOR_FORMAT_YCBCR420	(1 << DRM_OUTPUT_COLOR_FORMAT_YCBCR420)
> 
> Can we move this? Either up, directly after drm_output_color_format, or
> down, directly before color_formats.
>
> I think 8d70f395e6cb ("drm: Add support for a panel-orientation
> connector property, v6") didn't separate the two on purpose.

I'm not sure it's worth it, the last patch in this series will remove
these so it's not going to stick around either.

> >  	/**
> >  	 * @panel_orientation: Read only connector property for built-in panels,
> >  	 * indicating the orientation of the panel vs the device's casing.
> >  	 * drm_connector_init() sets this to DRM_MODE_PANEL_ORIENTATION_UNKNOWN.
> > @@ -712,14 +737,15 @@ struct drm_display_info {
> >  	 * fb to compensate and gets exported as prop to userspace.
> >  	 */
> >  	int panel_orientation;
> >  
> >  	/**
> > -	 * @color_formats: HDMI Color formats, selects between RGB and YCrCb
> > -	 * modes. Used DRM_COLOR_FORMAT\_ defines, which are _not_ the same ones
> > -	 * as used to describe the pixel format in framebuffers, and also don't
> > -	 * match the formats in @bus_formats which are shared with v4l.
> > +	 * @color_formats: HDMI Color formats, selects between RGB and
> > +	 * YCrCb modes. Uses a bitmask of DRM_OUTPUT_COLOR_FORMAT\_
> 
> Maybe s/YCrCb/YCbCr/ for consistency?

Yep, definitely. I'll update it.

Maxime

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

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

* Re: [PATCH 14/14] drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace
  2026-02-27  8:29     ` Maxime Ripard
@ 2026-02-27 12:46       ` Nicolas Frattaroli
  0 siblings, 0 replies; 28+ messages in thread
From: Nicolas Frattaroli @ 2026-02-27 12:46 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Jani Nikula, Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Simona Vetter, Harry Wentland, Leo Li, Rodrigo Siqueira,
	Alex Deucher, Christian König, Andrzej Hajda, Neil Armstrong,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Andy Yan, Liviu Dudau, Chun-Kuang Hu, Philipp Zabel,
	Matthias Brugger, AngeloGioacchino Del Regno, Sandy Huang,
	Heiko Stübner, Liu Ying, Chen-Yu Tsai, Samuel Holland,
	Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance,
	dri-devel, linux-kernel, amd-gfx, linux-mediatek,
	linux-arm-kernel, linux-rockchip, linux-sunxi

On Friday, 27 February 2026 09:29:05 Central European Standard Time Maxime Ripard wrote:
> Hi
> 
> On Thu, Feb 26, 2026 at 05:24:05PM +0100, Nicolas Frattaroli wrote:
> > On Tuesday, 24 February 2026 11:58:53 Central European Standard Time Maxime Ripard wrote:
> > > The hdmi_colorspace enum was defined to represent the colorspace value
> > > of the HDMI infoframes. It was later used by some HDMI drivers to
> > > express the output format they should be setting up.
> > > 
> > > During the introduction of the HDMI helpers, it then was used to
> > > represent it in the drm_connector_hdmi_state structure.
> > > 
> > > However, it's always been somewhat redundant with the DRM_COLOR_FORMAT_*
> > > defines, and now with the drm_output_color_format enum. Let's
> > > consolidate around drm_output_color_format in drm_connector_hdmi_state
> > > to facilitate the current effort to provide a global output format
> > > selection mechanism.
> > > 
> > > Signed-off-by: Maxime Ripard <mripard@kernel.org>
> > > ---
> > >  drivers/gpu/drm/bridge/inno-hdmi.c                 |   6 +-
> > >  drivers/gpu/drm/bridge/ite-it6263.c                |   2 +-
> > >  drivers/gpu/drm/display/drm_hdmi_helper.c          |   7 +-
> > >  drivers/gpu/drm/display/drm_hdmi_state_helper.c    |  52 ++++--
> > >  drivers/gpu/drm/drm_bridge.c                       |   2 +-
> > >  drivers/gpu/drm/drm_connector.c                    |  14 +-
> > >  drivers/gpu/drm/mediatek/mtk_hdmi_v2.c             |   8 +-
> > >  drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c             |   2 +-
> > >  drivers/gpu/drm/tests/drm_connector_test.c         |  80 ++++-----
> > >  drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 182 ++++++++++-----------
> > >  drivers/gpu/drm/vc4/vc4_hdmi.c                     |  18 +-
> > >  drivers/gpu/drm/vc4/vc4_hdmi.h                     |   2 +-
> > >  include/drm/display/drm_hdmi_helper.h              |   3 +-
> > >  include/drm/drm_connector.h                        |   7 +-
> > >  14 files changed, 205 insertions(+), 180 deletions(-)
> > > 
> > > [... snip ...]
> > > diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> > > index 4f5b27fab475c7c733622eb8727927571f3fb8fe..171cd495976a3e16f201fd339d3d42a09dc3b63f 100644
> > > --- a/drivers/gpu/drm/drm_connector.c
> > > +++ b/drivers/gpu/drm/drm_connector.c
> > > @@ -589,14 +589,14 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
> > >  
> > >  	if (!(connector_type == DRM_MODE_CONNECTOR_HDMIA ||
> > >  	      connector_type == DRM_MODE_CONNECTOR_HDMIB))
> > >  		return -EINVAL;
> > >  
> > > -	if (!supported_formats || !(supported_formats & BIT(HDMI_COLORSPACE_RGB)))
> > > +	if (!supported_formats || !(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444)))
> > >  		return -EINVAL;
> > >  
> > > -	if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(HDMI_COLORSPACE_YUV420)))
> > > +	if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)))
> > >  		return -EINVAL;
> > 
> > I don't think this will work as-is. drm_bridge_connector_init calls this
> > function assuming hdmi_colorspace bitmasks in supported_formats.
> 
> Yeah, you're right I missed the conversion in drm_bridge_connector_init.
> It should be fixed now.
> 
> > This may have slipped through the conversion; the synopsys dw-hdmi-qp core
> > (separate from synopsys dw-hdmi) also assumes hdmi_colorspace, see e.g.
> > dw_hdmi_qp_plat_data::supported_formats in include/drm/bridge/dw_hdmi_qp.h
> > 
> > So should be a simple fix I hope.
> 
> For this one, did you identify anything more than the comment in
> dw_hdmi_qp_plat_data? I couldn't find any user of HDMI_COLORSPACE_* left
> for the dw_hdmi_qp_plat_data.supported_formats users.

Nope, it's really just the comment. My series will obviously need
adjusting since it makes use of that member, but that's part of my
rebase. So far, there don't seem to be any users that set the member,
so it's just the comment documenting it.

Kind regards,
Nicolas Frattaroli
 
> Maxime
> 





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

* Re: [PATCH 01/14] drm/connector: Introduce drm_output_color_format enum
  2026-02-27  8:38     ` Maxime Ripard
@ 2026-02-27 15:10       ` Philipp Zabel
  0 siblings, 0 replies; 28+ messages in thread
From: Philipp Zabel @ 2026-02-27 15:10 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Nicolas Frattaroli, Jani Nikula, Maarten Lankhorst,
	Thomas Zimmermann, David Airlie, Simona Vetter, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Andy Yan, Liviu Dudau,
	Chun-Kuang Hu, Matthias Brugger, AngeloGioacchino Del Regno,
	Sandy Huang, Heiko Stübner, Liu Ying, Chen-Yu Tsai,
	Samuel Holland, Dave Stevenson, Maíra Canal,
	Raspberry Pi Kernel Maintenance, dri-devel, linux-kernel, amd-gfx,
	linux-mediatek, linux-arm-kernel, linux-rockchip, linux-sunxi

Hi Maxime,

On Fr, 2026-02-27 at 09:38 +0100, Maxime Ripard wrote:
[...]
> > Can we move this?
[...]
> 
> I'm not sure it's worth it, the last patch in this series will remove
> these so it's not going to stick around either.

I agree it's not, I just didn't look as far as patch 13.

regards
Philipp

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

end of thread, other threads:[~2026-02-27 15:11 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
2026-02-24 10:58 ` [PATCH 01/14] drm/connector: Introduce " Maxime Ripard
2026-02-26  9:12   ` Philipp Zabel
2026-02-27  8:38     ` Maxime Ripard
2026-02-27 15:10       ` Philipp Zabel
2026-02-24 10:58 ` [PATCH 02/14] drm/edid: Convert to " Maxime Ripard
2026-02-24 10:58 ` [PATCH 03/14] drm/display: hdmi: Convert to drm_output_color_format Maxime Ripard
2026-02-24 10:58 ` [PATCH 04/14] drm/amdgpu: display: " Maxime Ripard
2026-02-24 10:58 ` [PATCH 05/14] drm/bridge: adv7511: " Maxime Ripard
2026-02-24 10:58 ` [PATCH 06/14] drm/bridge: analogix: " Maxime Ripard
2026-02-24 10:58 ` [PATCH 07/14] drm/bridge: cadence: " Maxime Ripard
2026-02-24 10:58 ` [PATCH 08/14] drm/bridge: synopsys: dw-dp: " Maxime Ripard
2026-02-24 10:58 ` [PATCH 09/14] drm/bridge: synopsys: dw-hdmi: " Maxime Ripard
2026-02-26  8:59   ` Philipp Zabel
2026-02-24 10:58 ` [PATCH 10/14] drm/arm: komeda: " Maxime Ripard
2026-02-25 16:12   ` Liviu Dudau
2026-02-24 10:58 ` [PATCH 11/14] drm/mediatek: dp: " Maxime Ripard
2026-02-26  8:58   ` Philipp Zabel
2026-02-24 10:58 ` [PATCH 12/14] drm/rockchip: analogix: " Maxime Ripard
2026-02-24 10:58 ` [PATCH 13/14] drm/connector: Remove DRM_COLOR_FORMAT defines Maxime Ripard
2026-02-24 10:58 ` [PATCH 14/14] drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace Maxime Ripard
2026-02-24 12:43   ` Jani Nikula
2026-02-25 17:03   ` Nicolas Frattaroli
2026-02-25 17:21     ` Nicolas Frattaroli
2026-02-26 16:24   ` Nicolas Frattaroli
2026-02-27  8:29     ` Maxime Ripard
2026-02-27 12:46       ` Nicolas Frattaroli
2026-02-24 12:44 ` [PATCH 00/14] drm: Create drm_output_color_format enum Jani Nikula

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