drivers: display: ssd1322: fix only part of the image being diplayed

Only the first chunk of the desired image is displayed repeatedly over
the screen height (at least on an NHD-2.7-12864WDW3 display). Fix it
by computing the internal mono01 to 4bit grayscale conversion buffer
size correctly so it can fit the entire image.

Signed-off-by: Johan Lafon <johan.lafon@syslinbit.com>
This commit is contained in:
Johan Lafon 2024-11-04 12:08:29 +01:00 committed by Mahesh Mahadevan
parent a140dd3de9
commit 2b5ee0ca91
1 changed files with 3 additions and 1 deletions

View File

@ -358,7 +358,9 @@ static struct display_driver_api ssd1322_driver_api = {
};
#define SSD1322_CONV_BUFFER_SIZE(node_id) \
(DT_PROP(node_id, width) * DT_PROP(node_id, segments_per_pixel) * 4)
DIV_ROUND_UP(DT_PROP(node_id, width) * DT_PROP(node_id, height) * \
DT_PROP(node_id, segments_per_pixel), \
SEGMENTS_PER_BYTE)
#define SSD1322_DEFINE(node_id) \
static uint8_t conversion_buf##node_id[SSD1322_CONV_BUFFER_SIZE(node_id)]; \