[PATCH] drm/tiny: panel-mipi-dbi: Pass drm_client_setup_with_fourcc()

Thomas Zimmermann tzimmermann at suse.de
Thu Apr 17 07:05:41 UTC 2025



Am 16.04.25 um 15:30 schrieb Fabio Estevam:
> From: Fabio Estevam <festevam at denx.de>
>
> Since commit 559358282e5b ("drm/fb-helper: Don't use the preferred depth
> for the BPP default") an RGB565 CFAF240320X display no longer works
> correctly: the colors are wrong and the content appears twice on the
> screen, side by side.
>
> The reason for the regression is that bits per pixel is now 32 instead
> of 16 in the fb-helper driver.
>
> Fix this problem by passing drm_client_setup_with_fourcc() with the correct
> format depending on the bits per pixel information.
>
> Cc: stable at vger.kernel.org
> Fixes: 559358282e5b ("drm/fb-helper: Don't use the preferred depth for the BPP default")
> Signed-off-by: Fabio Estevam <festevam at denx.de>

Reviewed-by: Thomas Zimmermann <tzimmermann at suse.de>

> ---
>   drivers/gpu/drm/tiny/panel-mipi-dbi.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/tiny/panel-mipi-dbi.c b/drivers/gpu/drm/tiny/panel-mipi-dbi.c
> index 0460ecaef4bd..23914a9f7fd3 100644
> --- a/drivers/gpu/drm/tiny/panel-mipi-dbi.c
> +++ b/drivers/gpu/drm/tiny/panel-mipi-dbi.c
> @@ -390,7 +390,10 @@ static int panel_mipi_dbi_spi_probe(struct spi_device *spi)
>   
>   	spi_set_drvdata(spi, drm);
>   
> -	drm_client_setup(drm, NULL);
> +	if (bpp == 16)
> +		drm_client_setup_with_fourcc(drm, DRM_FORMAT_RGB565);
> +	else
> +		drm_client_setup_with_fourcc(drm, DRM_FORMAT_RGB888);
>   
>   	return 0;
>   }

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)



More information about the dri-devel mailing list