Skip to content

Commit 1bd1562

Browse files
cristicclumag
authored andcommitted
drm/bridge-connector: Sync supported_formats with computed ycbcr_420_allowed
The case of having an HDMI bridge in the pipeline which advertises YUV420 capability via its ->supported_formats and a non-HDMI one that didn't enable ->ycbcr_420_allowed, is incorrectly handled because supported_formats is passed as is to the helper initializing the HDMI connector. Ensure HDMI_COLORSPACE_YUV420 is removed from the bitmask passed to drmm_connector_hdmi_init() when connector's ->ycbcr_420_allowed flag ends up not being set. Fixes: 3ced1c6 ("drm/display: bridge_connector: handle ycbcr_420_allowed") Signed-off-by: Cristian Ciocaltea <[email protected]> Reviewed-by: Dmitry Baryshkov <[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 d102ac3 commit 1bd1562

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/gpu/drm/display/drm_bridge_connector.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,10 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
459459
if (connector_type == DRM_MODE_CONNECTOR_Unknown)
460460
return ERR_PTR(-EINVAL);
461461

462-
if (bridge_connector->bridge_hdmi)
462+
if (bridge_connector->bridge_hdmi) {
463+
if (!connector->ycbcr_420_allowed)
464+
supported_formats &= ~BIT(HDMI_COLORSPACE_YUV420);
465+
463466
ret = drmm_connector_hdmi_init(drm, connector,
464467
bridge_connector->bridge_hdmi->vendor,
465468
bridge_connector->bridge_hdmi->product,
@@ -468,10 +471,11 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
468471
connector_type, ddc,
469472
supported_formats,
470473
max_bpc);
471-
else
474+
} else {
472475
ret = drmm_connector_init(drm, connector,
473476
&drm_bridge_connector_funcs,
474477
connector_type, ddc);
478+
}
475479
if (ret)
476480
return ERR_PTR(ret);
477481

0 commit comments

Comments
 (0)