]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/tiny: panel-mipi-dbi: Use drm_client_setup_with_fourcc()
authorFabio Estevam <festevam@denx.de>
Thu, 17 Apr 2025 10:34:58 +0000 (07:34 -0300)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 12 May 2025 06:57:04 +0000 (08:57 +0200)
commit9c1798259b9420f38f1fa1b83e3d864c3eb1a83e
treed1eeb94d056aead80906bedf63b8d6a7b758b9b0
parenteb0851e14432f3b87c77b704c835ac376deda03a
drm/tiny: panel-mipi-dbi: Use drm_client_setup_with_fourcc()

Since commit 559358282e5b ("drm/fb-helper: Don't use the preferred depth
for the BPP default"), RGB565 displays such as the CFAF240320X no longer
render correctly: colors are distorted and the content is shown twice
horizontally.

This regression is due to the fbdev emulation layer defaulting to 32 bits
per pixel, whereas the display expects 16 bpp (RGB565). As a result, the
framebuffer data is incorrectly interpreted by the panel.

Fix the issue by calling drm_client_setup_with_fourcc() with a format
explicitly selected based on the display's bits-per-pixel value. For 16
bpp, use DRM_FORMAT_RGB565; for other values, fall back to the previous
behavior. This ensures that the allocated framebuffer format matches the
hardware expectations, avoiding color and layout corruption.

Tested on a CFAF240320X display with an RGB565 configuration, confirming
correct colors and layout after applying this patch.

Cc: stable@vger.kernel.org
Fixes: 559358282e5b ("drm/fb-helper: Don't use the preferred depth for the BPP default")
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20250417103458.2496790-1-festevam@gmail.com
drivers/gpu/drm/tiny/panel-mipi-dbi.c