]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/sitronix/st7586: fix bad pixel data due to byte swap
authorDavid Lechner <dlechner@baylibre.com>
Sun, 1 Mar 2026 04:30:30 +0000 (22:30 -0600)
committerDavid Lechner <dlechner@baylibre.com>
Sat, 7 Mar 2026 23:14:09 +0000 (17:14 -0600)
commit46d8a07b4ae262e2fec6ce2aa454e06243661265
tree9f498174e9e7ef32663a18966096e14bd1b1121d
parent021f1b77f70d62351bba67b050b8d784641d817f
drm/sitronix/st7586: fix bad pixel data due to byte swap

Correctly set dbi->write_memory_bpw for the ST7586 driver. This driver
is for a monochrome display that has an unusual data format, so the
default value set in mipi_dbi_spi_init() is not correct simply because
this controller is non-standard.

Previously, we were using dbi->swap_bytes to make the same sort of
workaround, but it was removed in the same commit that added
dbi->write_memory_bpw, so we need to use the latter now to have the
correct behavior.

This fixes every 3 columns of pixels being swapped on the display. There
are 3 pixels per byte, so the byte swap caused this effect.

Fixes: df3fb27a74a4 ("drm/mipi-dbi: Make bits per word configurable for pixel transfers")
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20260228-drm-mipi-dbi-fix-st7586-byte-swap-v1-1-e78f6c24cd28@baylibre.com
drivers/gpu/drm/sitronix/st7586.c