[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241130-hdmi-conn-yuv-v1-3-254279a08671@collabora.com>
Date: Sat, 30 Nov 2024 01:56:34 +0200
From: Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
To: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>
Cc: kernel@...labora.com, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 3/3] drm/connector: hdmi: Use YUV420 output format as an
RGB fallback
Introduce the switch to YUV420 when computing the best output format and
RGB cannot be supported for a given color depth.
While at it, add a minor improvement to the debug message indicating the
supported format.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
---
drivers/gpu/drm/display/drm_hdmi_state_helper.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
index 3a55881a544a519bb1254968db891c814f831a0f..b4e865e0680f35fd2d849536789f6c1f98a48258 100644
--- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
@@ -304,7 +304,7 @@ hdmi_try_format_bpc(const struct drm_connector *connector,
return false;
}
- drm_dbg_kms(dev, "%s output format supported with %u (TMDS char rate: %llu Hz)\n",
+ drm_dbg_kms(dev, "%s output format supported with %u bpc (TMDS char rate: %llu Hz)\n",
drm_hdmi_connector_get_output_format_name(fmt),
bpc, conn_state->hdmi.tmds_char_rate);
@@ -319,15 +319,16 @@ hdmi_compute_format(const struct drm_connector *connector,
{
struct drm_device *dev = connector->dev;
- /*
- * TODO: Add support for YCbCr420 output for HDMI 2.0 capable
- * devices, for modes that only support YCbCr420.
- */
if (hdmi_try_format_bpc(connector, conn_state, mode, bpc, HDMI_COLORSPACE_RGB)) {
conn_state->hdmi.output_format = HDMI_COLORSPACE_RGB;
return 0;
}
+ if (hdmi_try_format_bpc(connector, conn_state, mode, bpc, HDMI_COLORSPACE_YUV420)) {
+ conn_state->hdmi.output_format = HDMI_COLORSPACE_YUV420;
+ return 0;
+ }
+
drm_dbg_kms(dev, "Failed. No Format Supported for that bpc count.\n");
return -EINVAL;
--
2.47.0
Powered by blists - more mailing lists