diff --git a/boards/shields/st_lcd_dsi_mb1835/st_lcd_dsi_mb1835.overlay b/boards/shields/st_lcd_dsi_mb1835/st_lcd_dsi_mb1835.overlay index df57cd40a1bfd..c3361d3aee88b 100644 --- a/boards/shields/st_lcd_dsi_mb1835/st_lcd_dsi_mb1835.overlay +++ b/boards/shields/st_lcd_dsi_mb1835/st_lcd_dsi_mb1835.overlay @@ -88,7 +88,7 @@ status = "okay"; width = <480>; height = <480>; - pixel-format = ; + pixel-format = ; bl-ctrl-gpios = <&dsi_lcd_qsh_030 53 GPIO_ACTIVE_HIGH>; diff --git a/samples/subsys/input/draw_touch_events/src/main.c b/samples/subsys/input/draw_touch_events/src/main.c index ed232de08624a..a1bef59988fd3 100644 --- a/samples/subsys/input/draw_touch_events/src/main.c +++ b/samples/subsys/input/draw_touch_events/src/main.c @@ -70,7 +70,15 @@ static void clear_screen(void) for (x = 0; x < WIDTH; x += CROSS_DIM) { for (y = 0; y < HEIGHT; y += CROSS_DIM) { - display_write(display_dev, x, y, &buf_desc, buffer_cross_empty); + struct display_buffer_descriptor ddesc = buf_desc; + uint16_t rem_w = WIDTH - x; + uint16_t rem_h = HEIGHT - y; + + ddesc.width = MIN(buf_desc.width, rem_w); + ddesc.height = MIN(buf_desc.height, rem_h); + ddesc.buf_size = ddesc.width * ddesc.height * BPP; + + display_write(display_dev, x, y, &ddesc, buffer_cross_empty); } } }