[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5da069b6-8a99-79c2-109c-c85715165857@baylibre.com>
Date: Tue, 1 Mar 2022 10:18:09 +0100
From: Neil Armstrong <narmstrong@...libre.com>
To: "H. Nikolaus Schaller" <hns@...delico.com>,
Andrzej Hajda <andrzej.hajda@...el.com>,
Robert Foss <robert.foss@...aro.org>,
Paul Boddie <paul@...die.org.uk>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jernej Skrabec <jernej.skrabec@...il.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Paul Cercueil <paul@...pouillou.net>,
Maxime Ripard <maxime@...no.tech>,
Kieran Bingham <kieran.bingham+renesas@...asonboard.com>
Cc: letux-kernel@...nphoenux.org, linux-mips@...r.kernel.org,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
Jonas Karlman <jonas@...boo.se>
Subject: Re: [PATCH v16 4/4] drm/bridge: dw-hdmi: fix bus formats negotiation
for 8 bit modes
Hi,
On 26/02/2022 18:13, H. Nikolaus Schaller wrote:
> Commit 7cd70656d1285b ("drm/bridge: display-connector: implement bus fmts callbacks")
>
> introduced a new mechanism to negotiate bus formats between hdmi connectors
> and bridges which is to be used e.g. for the jz4780 based CI20 board.
>
> In this case dw-hdmi sets up a list of formats in
> dw_hdmi_bridge_atomic_get_output_bus_fmts().
>
> This includes e.g. MEDIA_BUS_FMT_UYVY8_1X16 which is chosen for the CI20 but
> only produces a black screen.
>
> Analysis revealed an omission in
>
> Commit 6c3c719936dafe ("drm/bridge: synopsys: dw-hdmi: add bus format negociation")
>
> to check for 8 bit with when adding UYVY8 or YUV8 formats.
>
> This fix is based on the observation that max_bpc = 0 when running this
> function while info->bpc = 8.
In fact if bpc = 0, it should be considered as 8, so the issue is elsewhere.
>
> Adding the proposed patch makes the jz4780/CI20 panel work again with default
> MEDIA_BUS_FMT_RGB888_1X24 mode.
>
> Fixes: 7cd70656d1285b ("drm/bridge: display-connector: implement bus fmts callbacks")
> Fixes: 6c3c719936dafe ("drm/bridge: synopsys: dw-hdmi: add bus format negociation")
> Signed-off-by: H. Nikolaus Schaller <hns@...delico.com>
> ---
> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 43e375da131e8..c08e2cc96584c 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -2621,11 +2621,13 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
> output_fmts[i++] = MEDIA_BUS_FMT_RGB101010_1X30;
> }
>
> - if (info->color_formats & DRM_COLOR_FORMAT_YCBCR422)
> - output_fmts[i++] = MEDIA_BUS_FMT_UYVY8_1X16;
> + if (max_bpc >= 8 && info->bpc >= 8) {
> + if (info->color_formats & DRM_COLOR_FORMAT_YCBCR422)
> + output_fmts[i++] = MEDIA_BUS_FMT_UYVY8_1X16;
>
> - if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
> - output_fmts[i++] = MEDIA_BUS_FMT_YUV8_1X24;
> + if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
> + output_fmts[i++] = MEDIA_BUS_FMT_YUV8_1X24;
> + }
It should not select YUV here if it's not possible, so something is wrong.
Can you check if https://lore.kernel.org/r/20220119123656.1456355-2-narmstrong@baylibre.com fixes this issue instead ?
Neil
>
> /* Default 8bit RGB fallback */
> output_fmts[i++] = MEDIA_BUS_FMT_RGB888_1X24;
Powered by blists - more mailing lists