Hi,
I am trying to understand LVGL for my project. I currently use Embedded Wizard for my project however, I may decide to replace it with LVGL. For that reason I am trying GUI-GUIDER-1.9.1-GA IDE on windows. I already have one MIMXRT1160-EVK board and so try sample examples in GUI GUIDER on that.
I am using v8.3.10 LVGL release and so MCUX SDK 2.16.000 package. While using it, I am creating and testing ScreenTransition Example on EVB Board.
When I deploy the built code to board with GUI GUIDER by clicking Run -> Build & Target -> MCUXpresso, it works however even though I checked VGLite option under Settings menu and Dİsplay Refresh Period(ms) as 10 and check all Monitor flags, I just see 8-10 FPS UI and CPU usage nearly %90.
So, it seems as if VGLite were not working well instead as if it were done with CPU.
I check it debugger but, in debugger All VGLite functions are executing. I put some breakpoints in files related with VGLite drawing under the folder lvgl/draw/nxp/vglite functions.
If this is the caused by LVGL itself, then LVGL really works very slowly. In Embedded wizard, I can run this type of widgets as 60Fps.
My other strange finding is that. I am importing this all generated code by GUI GUIDER in project folder to MCUXpresso IDE as new project. And there, I am recompiling all code and then loads to my board with my Ulink debugger. But when I do this, program again works well, however this time FPS value is dropping to 3-4 FPS levels. So, it works barely on my EVB Board.
I tried some MPU config settings by enabling and disabling cache. Closing and opening VGLite etc. however, it does not give me more than 4 fps. So why this method is yielding to different result? All the codes I am using are the ones directly got from GUI GUIDER output files. What is the problem?
I need to see 60FPS values with this ScreenTransition example. Please help me about it. Thanks a lot in advance
Hi @WenbinYuan,
I modified the DEMO_FlushDisplay(.....) function like the below;
static void DEMO_FlushDisplay(lv_disp_drv_t *disp_drv,
const lv_area_t *area,
lv_color_t *color_p)
{
int32_t x, y;
int32_t w = (area->x2 - area->x1 + 1);
int32_t h = (area->y2 - area->y1 + 1);
for (y = 0; y < h; y++)
{
memcpy(&s_frameBuffertemp[area->y1 + y][area->x1],
color_p + y * w,
w * sizeof(lv_color_t));
}
SCB_CleanInvalidateDCache_by_Addr((void *)&s_frameBuffertemp[area->y1][area->x1],
w * h * sizeof(lv_color_t));
g_dc.ops->setFrameBuffer(&g_dc, 0, (void *)s_frameBuffertemp);
lv_disp_flush_ready(disp_drv);
}
and added the below line to upmost of the file named "lvlg_support.c"
static uint32_t s_frameBuffertemp[DEMO_PANEL_HEIGHT][DEMO_PANEL_WIDTH] __attribute__((aligned(32)));
this time, widget runs faster. However, as you see in the code; I added an intermideate buffer and does copying operation with
CPU. So I do have to make this operation with VGLite.
As per my understanding; examples does not consider the "area" parameter in
static void DEMO_FlushDisplay(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p) function. That is why;
when I set disp_drv.full_refresh value as 0. the screen gets corrupted.
So, I need your help for writing above code with VGLite or any function which takes into effect "area" parameter for partial mode screen refresh
Hi @burhanhagi,
The partial refresh feature is not supported on the i.MX RT's MIPI peripheral, as mentioned in the following post: Solved: LVGL MIPI screen can't enter to partial refresh mode - NXP Community.
I tested the same project with the same LVGL library on the MIMXRT1160-EVK and got 10fps on the same screen. If you wish to improve the performance, please implement the following adaptations: GUIGUIDERUG_1.9.1: GUI Guider v1.9.1 User Guide | NXP Semiconductors
BR,
Edwin.
Hi @EdwinHz,
How much maximum FPS Can I reach when I implement the adaptions you suggest? Can I reach more than 30FPS?
I reviewed the adaptions link, but seems page not exist anymore. I could not view the page.
I read the link why partial mode is not supported. But I do not understand why it is impossible. Actually the link says nothing new for me and also does not mention why partial mode is not implemented. What is the problem with partial mode? If I use another different Display, such as 1280x800 Mipi Display, Is not it possible to implement partial Refresh? I really wonder what is the obstacle behind it?
Hi @burhanhagi,
> How much maximum FPS Can I reach when I implement the adaptions you suggest? Can I reach more than 30FPS?
You would have to perform the tests yourself.
> I reviewed the adaptions link, but seems page not exist anymore. I could not view the page.
You can find the information I am referring to on section "6.3 Performance optimization" of the following link: https://www.nxp.com/webapp/Download?colCode=GUIGUIDERUG_1.9.1
> What is the problem with partial mode? If I use another different Display, such as 1280x800 Mipi Display, Is not it possible to implement partial Refresh?
It's an issue with the MIPI peripheral of the RT1160 itself, so changing the display will unfortunately result in the same problem.
Hello @EdwinHz, @WenbinYuan ,
I performed many tests with MIMXRT1166-EVK Board. I enabled only PXP, only VGLite, both of them and finally disable both of them and observed its outputs on LCD Display. When I do that, I am setting the parameter "disp_drv.full_refresh = 1" (LVGL draws the whole 720x1280 screen each time)
*** When I only " #define LV_USE_GPU_NXP_VG_LITE 1 " : for "speed" screen fps value are too low as 7-8FPS, for "record" screen fps value is 3-4FPS and CPU usage is nearly %70 for both for ScreenTransition Example in GUIGuider.
*** When I only " #define LV_USE_GPU_NXP_PXP 1 " : for "speed" screen fps value are too low as 3-4FPS, CPU usage %93; "record" screen fps value is 15FPS and CPU usage is nearly %55 for ScreenTransition Example in GUIGuider.
*** When I both " #define LV_USE_GPU_NXP_PXP 0 " and " #define LV_USE_GPU_NXP_VG_LITE 0 " : and set the parameter "disp_drv.full_refresh = 0" in lvgl_support.c file and finally replace the flush function in lvgl_support.c file in SDK with my below function. (LVGL draws only changing areas to LCD Display, not the whole 720x1280 buffer. )
static void DEMO_FlushDisplay(lv_disp_drv_t *disp_drv,
const lv_area_t *area,
lv_color_t *color_p)
{
int32_t x, y;
int32_t w = (area->x2 - area->x1 + 1);
int32_t h = (area->y2 - area->y1 + 1);
for (y = 0; y < h; y++)
{
memcpy(&s_frameBuffertemp[area->y1 + y][area->x1],
color_p + y * w,
w * sizeof(lv_color_t));
}
SCB_CleanInvalidateDCache_by_Addr((void *)&s_frameBuffertemp[area->y1][area->x1],
w * h * sizeof(lv_color_t));
g_dc.ops->setFrameBuffer(&g_dc, 0, (void *)s_frameBuffertemp);
lv_disp_flush_ready(disp_drv);
}
for "speed" screen fps value are too high nearly 23-25Fps, CPU usage %100; "record" screen fps value is 20FPS and CPU usage is nearly %68 for ScreenTransition Example in GUIGuider.
So, as a conclusion, NXP LVGL VGLite library is working very badly. NXP LVGL PXP works a little bit better. However CPU without using any GPU works the best. So, I previously would have suspected as LVGL was not working well. But from above results, LVGL works as expected very good but NXP hardware accelerator libraries are really working very bad. I applied all the directives in below SS, however the final situation is as I explained.
I really wonder why PXP or VGLite does not perform drawings only for changing areas in screen instead of drawing the whole screen. Is not there a possible way using any of one of GPUs instead of CPU?
By the way, I also performed this below test, too.
*** When I both " #define LV_USE_GPU_NXP_PXP 0 " and " #define LV_USE_GPU_NXP_VG_LITE 0 " : and set the parameter "disp_drv.full_refresh = 1" in lvgl_support.c file and used the original flush function in SDK , not used above my one because of setting "disp_drv.full_refresh = 1". (So, LVGL again draws the whole 720x1280 screen each time). I really surprised the results even though I have used no any GPU;
for "speed" screen fps value I got 7 FPS and CPU usage %100 , for "record" screen fps value is 13-14 FPS and CPU usage is nearly %78 for both for ScreenTransition Example in GUIGuider.
So even thoguh I use full frame buffer each time, CPU works very good compared to enabling to use VGLite or PXP. Using GPU made worse performance so much. It is very surprising!
You can try doing test on your board. Or I can share short videos for each setting during test
Waiting your comments.
Hi @WenbinYuan,
My display panel code : RK055HDMIPI4MA0 ( 720 (width) x 1280 (height) )
In below; I added 2 different short videos displaying the problem occuring. Please view the videos in the link.
In code, there is a file named lvgl_support.c under the folder "board". All display pre-config settings is being done there.
I am changing the values of two variables of structure within that file.
/* Partial refresh */
disp_drv.full_refresh = 1;
disp_drv.direct_mode = 0;
In first video; I have set full_refresh as 0 and direct_mode as 1. However, as you notice in the video, fps values reaches 20fps but widget runs abnormal, especially while changing and restoring the screen.
In second video; I ahve set full_refresh as 1 and direct_mode as 0. But this time fps values is about 7-8 fps. But this time screen runs as expected as always. But runs very slowly as I said. Both of videos are complied with optimization level as -O3.
IMXRT1166EvalBoard_lvgl_works_too_slowly
As I already said, In embedded wizard I can run this widget as nearly 60Fps but in LVGL seems not reachable even 30Fps values.
Hello,
Difference between running the code directly over GUI GUIDER and importing & compiling & running from MCUXPresso IDE is caused by Compiler Optimization. I selected both C++ and C Compiler Optimization to Level -O3(Most). and it results FPS value to higher 7-8 FPS. This FPS value now is the same as output of GUI GUIDER when I loaded & run to my board over it.
But as I said before 7-8 FPS is very very low. Even though widget is so simple, it barely runs. Which point am I missing?
Hello @burhanhagi,
May I know what display panel you are using?
The low FPS issue is mainly caused by large resolution(720x1280) and full screen refresh mechanism, and the Meter widget is also hign load with customized ticks, arc and needles.
Best Regards,
Wenbin