Skip to content

Commit a0b223a

Browse files
committed
lvgl: add frame_incomplete information to display_write
In frames with multiple writes (officially supported through `CONFIG_LV_Z_VDB_SIZE`) the display needs to be signalled that the current frame is over and the content should be displayed. This allows displays to present the UI without tearing artifacts. Signed-off-by: Martin Stumpf <[email protected]>
1 parent 7c3b1c0 commit a0b223a

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

doc/releases/release-notes-4.1.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ Trusted Firmware-M
282282
LVGL
283283
****
284284

285+
* Added ``frame_incomplete`` support to indicate whether a write is the last
286+
write of the frame (:github:`81250`)
287+
285288
Tests and Samples
286289
*****************
287290

modules/lvgl/lvgl_display.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ void lvgl_flush_thread_entry(void *arg1, void *arg2, void *arg3)
2525
k_msgq_get(&flush_queue, &flush, K_FOREVER);
2626
data = (struct lvgl_disp_data *)flush.disp_drv->user_data;
2727

28+
flush.desc.frame_incomplete = !lv_disp_flush_is_last(flush.disp_drv);
2829
display_write(data->display_dev, flush.x, flush.y, &flush.desc,
2930
flush.buf);
3031

@@ -132,6 +133,7 @@ void lvgl_flush_display(struct lvgl_display_flush *request)
132133
struct lvgl_disp_data *data =
133134
(struct lvgl_disp_data *)request->disp_drv->user_data;
134135

136+
request->desc.frame_incomplete = !lv_disp_flush_is_last(request->disp_drv);
135137
display_write(data->display_dev, request->x, request->y,
136138
&request->desc, request->buf);
137139
lv_disp_flush_ready(request->disp_drv);

modules/lvgl/lvgl_display_mono.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ void lvgl_flush_cb_mono(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color
1414
uint16_t h = area->y2 - area->y1 + 1;
1515
struct lvgl_disp_data *data = (struct lvgl_disp_data *)disp_drv->user_data;
1616
const struct device *display_dev = data->display_dev;
17-
struct display_buffer_descriptor desc;
1817
const bool is_epd = data->cap.screen_info & SCREEN_INFO_EPD;
1918
const bool is_last = lv_disp_flush_is_last(disp_drv);
2019

@@ -29,10 +28,14 @@ void lvgl_flush_cb_mono(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color
2928
data->blanking_on = true;
3029
}
3130

32-
desc.buf_size = (w * h) / 8U;
33-
desc.width = w;
34-
desc.pitch = w;
35-
desc.height = h;
31+
struct display_buffer_descriptor desc = {
32+
.buf_size = (w * h) / 8U,
33+
.width = w,
34+
.pitch = w,
35+
.height = h,
36+
.frame_incomplete = !is_last,
37+
};
38+
3639
display_write(display_dev, area->x1, area->y1, &desc, (void *)color_p);
3740
if (data->cap.screen_info & SCREEN_INFO_DOUBLE_BUFFER) {
3841
display_write(display_dev, area->x1, area->y1, &desc, (void *)color_p);

0 commit comments

Comments
 (0)