[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fxejrxzouuwioyfu5hcrpsy5mabmjknxvtozefrkx4fnb2phog@ncc2wrli7uks>
Date: Tue, 24 Dec 2024 21:08:27 +0200
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
Cc: Andrzej Hajda <andrzej.hajda@...el.com>,
Neil Armstrong <neil.armstrong@...aro.org>, Robert Foss <rfoss@...nel.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>, Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...il.com>, 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>, kernel@...labora.com,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/4] drm/bridge: Prioritize supported_formats over
ycbcr_420_allowed
On Tue, Dec 24, 2024 at 08:22:41PM +0200, Cristian Ciocaltea wrote:
> 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: 3ced1c687512 ("drm/display: bridge_connector: handle ycbcr_420_allowed")
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
> ---
> drivers/gpu/drm/drm_bridge.c | 4 ++++
> 1 file changed, 4 insertions(+)
I'm still slightly torn between this patch and a simple
drm_WARN_ON(bridge->dev, bridge->ycbcr_420_allowed !=
(bridge->supported_formats & BIT(HDMI_COLORSPACE_YUV420)))
Nevertheless,
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
>
> diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
> index c6af46dd02bfa9e15b59e4c460debdd7fd84be44..241a384ebce39b4a3db58c208af27960904fc662 100644
> --- a/drivers/gpu/drm/drm_bridge.c
> +++ b/drivers/gpu/drm/drm_bridge.c
> @@ -207,6 +207,10 @@ void drm_bridge_add(struct drm_bridge *bridge)
> {
> mutex_init(&bridge->hpd_mutex);
>
> + if (bridge->ops & DRM_BRIDGE_OP_HDMI)
> + bridge->ycbcr_420_allowed = !!(bridge->supported_formats &
> + BIT(HDMI_COLORSPACE_YUV420));
> +
> mutex_lock(&bridge_lock);
> list_add_tail(&bridge->list, &bridge_list);
> mutex_unlock(&bridge_lock);
>
> --
> 2.47.0
>
--
With best wishes
Dmitry
Powered by blists - more mailing lists