modules: lvgl: Add support for frame rounder callback
Add support for LVGL rounder callback function. Sometimes, either the underlying display controller and/or the LCD host controller might impose restrictions on frame resolution. For instance, the E1394AA65A display model should impose that either axis of a frame be multiple of 2 pixels or the Renesas LCD controller of the DA1469x SoC, should impose that the stride value, number of bytes between consecutive frame lines, be multiple of 4 bytes. Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
This commit is contained in:
parent
9fc9eb5ddb
commit
fce35569b8
|
@ -52,6 +52,10 @@ config LV_Z_LOG_LEVEL
|
|||
default 3 if LV_LOG_LEVEL_USER
|
||||
default 4 if LV_LOG_LEVEL_TRACE
|
||||
|
||||
config LV_Z_USE_ROUNDER_CB
|
||||
bool
|
||||
default y if LV_Z_AREA_X_ALIGNMENT_WIDTH != 1 || LV_Z_AREA_Y_ALIGNMENT_WIDTH != 1
|
||||
|
||||
config APP_LINK_WITH_LVGL
|
||||
bool "Link 'app' with LVGL"
|
||||
default y
|
||||
|
@ -107,6 +111,22 @@ config LV_Z_FLUSH_THREAD_PRIO
|
|||
|
||||
endif # LV_Z_FLUSH_THREAD
|
||||
|
||||
config LV_Z_AREA_X_ALIGNMENT_WIDTH
|
||||
int "Frame X alignment size"
|
||||
default 1
|
||||
help
|
||||
Number of pixels, X axis should be rounded to. Should be used to override
|
||||
the current frame dimensions to meet display and/or LCD host
|
||||
controller requirements. The value must be power of 2.
|
||||
|
||||
config LV_Z_AREA_Y_ALIGNMENT_WIDTH
|
||||
int "Frame Y alignment size"
|
||||
default 1
|
||||
help
|
||||
Number of pixels, Y axis should be rounded to. Should be used to override
|
||||
the current frame dimensions to meet display and/or LCD host
|
||||
controller requirements. The value must be power of 2.
|
||||
|
||||
rsource "Kconfig.memory"
|
||||
rsource "Kconfig.input"
|
||||
rsource "Kconfig.shell"
|
||||
|
|
|
@ -49,6 +49,10 @@ int set_lvgl_rendering_cb(lv_disp_drv_t *disp_drv);
|
|||
|
||||
void lvgl_flush_display(struct lvgl_display_flush *request);
|
||||
|
||||
#ifdef CONFIG_LV_Z_USE_ROUNDER_CB
|
||||
void lvgl_rounder_cb(lv_disp_drv_t *disp_drv, lv_area_t *area);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -45,6 +45,26 @@ void lvgl_wait_cb(lv_disp_drv_t *disp_drv)
|
|||
|
||||
#endif /* CONFIG_LV_Z_FLUSH_THREAD */
|
||||
|
||||
#ifdef CONFIG_LV_Z_USE_ROUNDER_CB
|
||||
void lvgl_rounder_cb(lv_disp_drv_t *disp_drv, lv_area_t *area)
|
||||
{
|
||||
#if CONFIG_LV_Z_AREA_X_ALIGNMENT_WIDTH != 1
|
||||
__ASSERT(POPCOUNT(CONFIG_LV_Z_AREA_X_ALIGNMENT_WIDTH) == 1, "Invalid X alignment width");
|
||||
|
||||
area->x1 &= ~(CONFIG_LV_Z_AREA_X_ALIGNMENT_WIDTH - 1);
|
||||
area->x2 |= (CONFIG_LV_Z_AREA_X_ALIGNMENT_WIDTH - 1);
|
||||
#endif
|
||||
#if CONFIG_LV_Z_AREA_Y_ALIGNMENT_WIDTH != 1
|
||||
__ASSERT(POPCOUNT(CONFIG_LV_Z_AREA_Y_ALIGNMENT_WIDTH) == 1, "Invalid Y alignment width");
|
||||
|
||||
area->y1 &= ~(CONFIG_LV_Z_AREA_Y_ALIGNMENT_WIDTH - 1);
|
||||
area->y2 |= (CONFIG_LV_Z_AREA_Y_ALIGNMENT_WIDTH - 1);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
#define lvgl_rounder_cb NULL
|
||||
#endif
|
||||
|
||||
int set_lvgl_rendering_cb(lv_disp_drv_t *disp_drv)
|
||||
{
|
||||
int err = 0;
|
||||
|
@ -57,7 +77,7 @@ int set_lvgl_rendering_cb(lv_disp_drv_t *disp_drv)
|
|||
switch (data->cap.current_pixel_format) {
|
||||
case PIXEL_FORMAT_ARGB_8888:
|
||||
disp_drv->flush_cb = lvgl_flush_cb_32bit;
|
||||
disp_drv->rounder_cb = NULL;
|
||||
disp_drv->rounder_cb = lvgl_rounder_cb;
|
||||
#ifdef CONFIG_LV_COLOR_DEPTH_32
|
||||
disp_drv->set_px_cb = NULL;
|
||||
#else
|
||||
|
@ -66,13 +86,13 @@ int set_lvgl_rendering_cb(lv_disp_drv_t *disp_drv)
|
|||
break;
|
||||
case PIXEL_FORMAT_RGB_888:
|
||||
disp_drv->flush_cb = lvgl_flush_cb_24bit;
|
||||
disp_drv->rounder_cb = NULL;
|
||||
disp_drv->rounder_cb = lvgl_rounder_cb;
|
||||
disp_drv->set_px_cb = lvgl_set_px_cb_24bit;
|
||||
break;
|
||||
case PIXEL_FORMAT_RGB_565:
|
||||
case PIXEL_FORMAT_BGR_565:
|
||||
disp_drv->flush_cb = lvgl_flush_cb_16bit;
|
||||
disp_drv->rounder_cb = NULL;
|
||||
disp_drv->rounder_cb = lvgl_rounder_cb;
|
||||
#ifdef CONFIG_LV_COLOR_DEPTH_16
|
||||
disp_drv->set_px_cb = NULL;
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue