Skip to content
Snippets Groups Projects
Unverified Commit 1e144846 authored by John Keeping's avatar John Keeping Committed by Javier Martinez Canillas
Browse files

drm/ssd130x: fix ssd132x encoding


The ssd132x buffer is encoded one pixel per nibble, with two pixels in
each byte.  When encoding an 8-bit greyscale input, take the top 4-bits
as the value and ensure the two pixels are distinct and do not overwrite
each other.

Fixes: fdd591e0 ("drm/ssd130x: Add support for the SSD132x OLED controller family")
Signed-off-by: default avatarJohn Keeping <jkeeping@inmusicbrands.com>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250115110139.1672488-2-jkeeping@inmusicbrands.com


Signed-off-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
parent 00728273
No related branches found
No related tags found
No related merge requests found
...@@ -880,7 +880,7 @@ static int ssd132x_update_rect(struct ssd130x_device *ssd130x, ...@@ -880,7 +880,7 @@ static int ssd132x_update_rect(struct ssd130x_device *ssd130x,
u8 n1 = buf[i * width + j]; u8 n1 = buf[i * width + j];
u8 n2 = buf[i * width + j + 1]; u8 n2 = buf[i * width + j + 1];
data_array[array_idx++] = (n2 << 4) | n1; data_array[array_idx++] = (n2 & 0xf0) | (n1 >> 4);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment