Skip to content

Commit f2f9661

Browse files
cristicclumag
authored andcommitted
drm/connector: hdmi: Validate supported_formats matches ycbcr_420_allowed
Ensure HDMI connector initialization fails when the presence of HDMI_COLORSPACE_YUV420 in the given supported_formats bitmask doesn't match the value of drm_connector->ycbcr_420_allowed. Suggested-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Cristian Ciocaltea <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 1bd1562 commit f2f9661

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/drm_connector.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,9 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
507507
if (!supported_formats || !(supported_formats & BIT(HDMI_COLORSPACE_RGB)))
508508
return -EINVAL;
509509

510+
if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(HDMI_COLORSPACE_YUV420)))
511+
return -EINVAL;
512+
510513
if (!(max_bpc == 8 || max_bpc == 10 || max_bpc == 12))
511514
return -EINVAL;
512515

0 commit comments

Comments
 (0)