zephyr/modules/lvgl/lvgl_display.h
Daniel DeGrasse da59df2905 modules: lvgl: allow offloading rendering process to background thread
Enable offloading of display_write call to background thread for color
displays. This feature is opt-in, as it may offer significant
performance gains for every display pipeline.

When enabled display_write and lv_disp_flush_ready will be called from a
background thread. This means that while the display driver waits on the
hardware to render the framebuffer, the LVGL rendering thread will not
be blocked.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-08-22 18:05:58 +02:00

57 lines
1.8 KiB
C

/*
* Copyright (c) 2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
* Copyright 2023 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_MODULES_LVGL_DISPLAY_H_
#define ZEPHYR_MODULES_LVGL_DISPLAY_H_
#include <zephyr/drivers/display.h>
#include <lvgl.h>
#ifdef __cplusplus
extern "C" {
#endif
struct lvgl_disp_data {
const struct device *display_dev;
struct display_capabilities cap;
bool blanking_on;
};
struct lvgl_display_flush {
lv_disp_drv_t *disp_drv;
uint16_t x;
uint16_t y;
struct display_buffer_descriptor desc;
void *buf;
};
void lvgl_flush_cb_mono(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p);
void lvgl_flush_cb_16bit(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p);
void lvgl_flush_cb_24bit(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p);
void lvgl_flush_cb_32bit(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p);
void lvgl_set_px_cb_mono(lv_disp_drv_t *disp_drv, uint8_t *buf, lv_coord_t buf_w, lv_coord_t x,
lv_coord_t y, lv_color_t color, lv_opa_t opa);
void lvgl_set_px_cb_16bit(lv_disp_drv_t *disp_drv, uint8_t *buf, lv_coord_t buf_w, lv_coord_t x,
lv_coord_t y, lv_color_t color, lv_opa_t opa);
void lvgl_set_px_cb_24bit(lv_disp_drv_t *disp_drv, uint8_t *buf, lv_coord_t buf_w, lv_coord_t x,
lv_coord_t y, lv_color_t color, lv_opa_t opa);
void lvgl_set_px_cb_32bit(lv_disp_drv_t *disp_drv, uint8_t *buf, lv_coord_t buf_w, lv_coord_t x,
lv_coord_t y, lv_color_t color, lv_opa_t opa);
void lvgl_rounder_cb_mono(lv_disp_drv_t *disp_drv, lv_area_t *area);
int set_lvgl_rendering_cb(lv_disp_drv_t *disp_drv);
void lvgl_flush_display(struct lvgl_display_flush *request);
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_MODULES_LVGL_DISPLAY_H_ */