-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Description
imxrt-1052-based board
Zephyr SHA-1: 0714052
integrated LVGL- SHA-1: 2b498e6f36d6b82ae1da12c8b7742e318624ecf5
LCD-panel 1024/768
My application should use 270 deg rotated orientation of lcd-panel. During lvgl_init() in zephyr\modules\lvgl\lvgl.c lvgl-disp resolution is set based on display_get_capabilities() output. But mcux_elcdif_get_capabilities() returns x/y_resolution of lcd-panel excluding rotation. So my lvgl-disp initilized as W=1024, H=768, instead of W=768, H=1024. imxrt has a built-in GPU/PXP which is used in elcdif-driver to rotate an image but this CONFIG_MCUX_ELCDIF_PXP_ROTATE_90/180/270 considered for data rotation, but not taken into account when determining display capabilities - if rotate 90/270 is active display height and width should be swaped. Is this a feature or bug? I think get_capabilties() should return rotated resolution (lvgl_allocate_rendering_buffers() must take into account display rotation when adjusting disp_driver->hor_res/ver_res).
As far as I know LVGL-lib has built-in rotation mechanism using NXP_PXP. So I tried to enable it by insert CONFIG_LV_USE_GPU_NXP_PXP in my prj.conf, but received error message
modules/lib/gui/lvgl/src/draw/nxp/pxp/lv_draw_pxp_blend.c:37:10: fatal error: lvgl_support.h: No such file or directory
So it seems this option not integrated into Zephyr, or some files missed. Am I missing something?
If CONFIG_MCUX_ELCDIF_PXP_ROTATE_90/180/270 is activated via prj.conf PXP will be used only if x=0,y=0 and full buffer should be outputed in mcux_elcdif_write(). In case partial buffer output such code used
src = buf;
dst = dev_data->fb[dev_data->next_idx];
dst += dev_data->pixel_bytes * (y * config->rgb_mode.panelWidth + x);
for (h_idx = 0; h_idx < desc->height; h_idx++) {
memcpy(dst, src, dev_data->pixel_bytes * desc->width);
src += dev_data->pixel_bytes * desc->pitch;
dst += dev_data->pixel_bytes * config->rgb_mode.panelWidth;
}
This code does not take into account rotation, so the output buffer may contain both rotated and unrotated data. So need to add code to rotate data. I have an example used in previous appl to rotate 270 deg.