drm/connector: hdmi: Use YUV420 output format as an RGB fallback
Try to make use of YUV420 when computing the best output format and RGB cannot be supported for any of the available color depths. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Reviewed-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250527-hdmi-conn-yuv-v5-6-74c9c4a8ac0c@collabora.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
committed by
Maxime Ripard
parent
4809299add
commit
04561845fc
@@ -649,12 +649,22 @@ hdmi_compute_config(const struct drm_connector *connector,
|
||||
8, connector->max_bpc);
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* TODO: Add support for YCbCr420 output for HDMI 2.0 capable
|
||||
* devices, for modes that only support YCbCr420.
|
||||
*/
|
||||
ret = hdmi_compute_format_bpc(connector, conn_state, mode, max_bpc,
|
||||
HDMI_COLORSPACE_RGB);
|
||||
if (ret) {
|
||||
if (connector->ycbcr_420_allowed) {
|
||||
ret = hdmi_compute_format_bpc(connector, conn_state,
|
||||
mode, max_bpc,
|
||||
HDMI_COLORSPACE_YUV420);
|
||||
if (ret)
|
||||
drm_dbg_kms(connector->dev,
|
||||
"YUV420 output format doesn't work.\n");
|
||||
} else {
|
||||
drm_dbg_kms(connector->dev,
|
||||
"YUV420 output format not allowed for connector.\n");
|
||||
ret = -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user