From 2b5ee0ca91e34944f75580317274c135a5d7c855 Mon Sep 17 00:00:00 2001 From: Johan Lafon Date: Mon, 4 Nov 2024 12:08:29 +0100 Subject: [PATCH] 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 --- drivers/display/ssd1322.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/display/ssd1322.c b/drivers/display/ssd1322.c index 75d2d1c90a2..9dee7d3d4c5 100644 --- a/drivers/display/ssd1322.c +++ b/drivers/display/ssd1322.c @@ -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)]; \