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 <finomnis@gmail.com>
This commit is contained in:
Martin Stumpf 2024-10-17 10:25:17 +02:00 committed by Anas Nashif
parent 2bdffc6818
commit 05bb8d9504
3 changed files with 13 additions and 5 deletions

View File

@ -282,6 +282,9 @@ Trusted Firmware-M
LVGL
****
* Added ``frame_incomplete`` support to indicate whether a write is the last
write of the frame (:github:`81250`)
Tests and Samples
*****************

View File

@ -25,6 +25,7 @@ void lvgl_flush_thread_entry(void *arg1, void *arg2, void *arg3)
k_msgq_get(&flush_queue, &flush, K_FOREVER);
data = (struct lvgl_disp_data *)flush.disp_drv->user_data;
flush.desc.frame_incomplete = !lv_disp_flush_is_last(flush.disp_drv);
display_write(data->display_dev, flush.x, flush.y, &flush.desc,
flush.buf);
@ -132,6 +133,7 @@ void lvgl_flush_display(struct lvgl_display_flush *request)
struct lvgl_disp_data *data =
(struct lvgl_disp_data *)request->disp_drv->user_data;
request->desc.frame_incomplete = !lv_disp_flush_is_last(request->disp_drv);
display_write(data->display_dev, request->x, request->y,
&request->desc, request->buf);
lv_disp_flush_ready(request->disp_drv);

View File

@ -14,7 +14,6 @@ void lvgl_flush_cb_mono(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color
uint16_t h = area->y2 - area->y1 + 1;
struct lvgl_disp_data *data = (struct lvgl_disp_data *)disp_drv->user_data;
const struct device *display_dev = data->display_dev;
struct display_buffer_descriptor desc;
const bool is_epd = data->cap.screen_info & SCREEN_INFO_EPD;
const bool is_last = lv_disp_flush_is_last(disp_drv);
@ -29,10 +28,14 @@ void lvgl_flush_cb_mono(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color
data->blanking_on = true;
}
desc.buf_size = (w * h) / 8U;
desc.width = w;
desc.pitch = w;
desc.height = h;
struct display_buffer_descriptor desc = {
.buf_size = (w * h) / 8U,
.width = w,
.pitch = w,
.height = h,
.frame_incomplete = !is_last,
};
display_write(display_dev, area->x1, area->y1, &desc, (void *)color_p);
if (data->cap.screen_info & SCREEN_INFO_DOUBLE_BUFFER) {
display_write(display_dev, area->x1, area->y1, &desc, (void *)color_p);