Re: [PATCH] drm/sitronix/st7586: fix bad pixel data due to byte swap
From: David Lechner
Date: Sat Mar 07 2026 - 18:27:51 EST
On 3/5/26 4:36 AM, Javier Martinez Canillas wrote:
> David Lechner <dlechner@xxxxxxxxxxxx> writes:
>
>> 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")
>> Signed-off-by: David Lechner <dlechner@xxxxxxxxxxxx>
>> ---
>
> The patch looks good to me.
>
> Reviewed-by: Javier Martinez Canillas <javierm@xxxxxxxxxx>
>
I pushed this out with: dim push-branch drm-misc-fixes
(It's been 5 years since I've done that, so hopefully I did it right - I followed
the docs and it all seemed OK to me).