Skip to content

Commit d102ac3

Browse files
cristicclumag
authored andcommitted
drm/bridge: Prioritize supported_formats over ycbcr_420_allowed
Bridges having DRM_BRIDGE_OP_HDMI set in their ->ops are supposed to rely on the ->supported_formats bitmask to advertise the permitted colorspaces, including HDMI_COLORSPACE_YUV420. However, a new flag ->ycbcr_420_allowed has been recently introduced, which brings the necessity to require redundant and potentially inconsistent information to be provided on HDMI bridges initialization. Adjust ->ycbcr_420_allowed for HDMI bridges according to ->supported_formats, right before adding them to the global bridge list. This keeps the initialization process straightforward and unambiguous, thereby preventing any further confusion. 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 35243fc commit d102ac3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/drm/drm_bridge.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ void drm_bridge_add(struct drm_bridge *bridge)
207207
{
208208
mutex_init(&bridge->hpd_mutex);
209209

210+
if (bridge->ops & DRM_BRIDGE_OP_HDMI)
211+
bridge->ycbcr_420_allowed = !!(bridge->supported_formats &
212+
BIT(HDMI_COLORSPACE_YUV420));
213+
210214
mutex_lock(&bridge_lock);
211215
list_add_tail(&bridge->list, &bridge_list);
212216
mutex_unlock(&bridge_lock);

0 commit comments

Comments
 (0)