Has anyone been able to figure out what code needs to be modified in 'lvgl_support.c' to be able to have LVGL draw buffers be 1/10th the size of the screen as described below:
Draw buffer(s) are simple array(s) that LVGL uses to render the screen content. Once rendering is ready the content of the draw buffer is sent to the display using the flush_cb function set in the display driver (see below).
A draw buffer can be initialized via a lv_disp_draw_buf_t variable like this:
/*A static or global variable to store the buffers*/ static lv_disp_draw_buf_t disp_buf; /*Static or global buffer(s). The second buffer is optional*/ static lv_color_t buf_1[MY_DISP_HOR_RES * 10]; static lv_color_t buf_2[MY_DISP_HOR_RES * 10]; /*Initialize `disp_buf` with the buffer(s). With only one buffer use NULL instead buf_2 */ lv_disp_draw_buf_init(&disp_buf, buf_1, buf_2, MY_DISP_HOR_RES*10);Note that lv_disp_draw_buf_t must be a static, global or dynamically allocated variable. It cannot be a local variable as they are destroyed upon end of scope.
As you can see above, the draw buffer may be smaller than the screen. In this case, larger areas are redrawn in smaller segments that fit into the draw buffer(s). If only a small area changes (e.g. a button is pressed) then only that area will be refreshed.
A larger buffer results in better performance but above 1/10 screen sized buffer(s) there is no significant performance improvement. Therefore it's recommended to choose the size of the draw buffer(s) to be at least 1/10 screen sized.
The 'lvgl_support.c' file can be found from the SDK_2.x_MIMXRT1170-EVK version 2.16.000, any of the lvgl_examples.
Hi @CMoran ,
Thanks for your interest in NXP MIMXRT series!
The SDK for the RT series MCUs uses full-size frame buffers for flush operations. For your application scenario, you can refer to examples in the MCX series SDK, such as MCXN947. It utilizes a virtual buffer size and the LV_DISPLAY_RENDER_MODE_PARTIAL mode.
Best regards,
Gavin