Hi,
I am using the lvgl_guider_cm7 example from SDK 2.15.100 with the 5" TFT display that fits to the board.
We're designing a custom board and want to get rid of the external SDRAM since our UI is not that demanding and we can live with 2MB internal RAM.
However, we can not use full sized framebuffers, so my question is: is it possible to use partial refresh with framebuffers that do not cover the full screen resolution?
I don't find an example for that and before I try to modify the existing one, it'd be helpful to know if it's possible at all.
Best regards
Rainer
It seems to me that the display panel that nxp sells with the iMXRT1170 board does only support video mode so I have to use full-sized frame buffers.
Application note AN13573 is a good source for information on these topics.
Hi @hfuhruhurr,
This is correct, if you have further inquiries about this topic don't hesitate to let me know.
BR,
Edwin.
modifying
DEMO_FlushDisplay
like this:
DEMO_FLUSH_DCACHE();
dc_fb_info_t fb_info;
g_dc.ops->getLayerDefaultConfig(&g_dc, 0, &fb_info);
fb_info.startX = area->x1;
fb_info.startY = area->y1;
fb_info.height = area->y2 - area->y1 + 1;
fb_info.width = area->x2 - area->x1 + 1;
fb_info.strideBytes = fb_info.width *2;
g_dc.ops->setFrameBuffer(&g_dc, 0, (void *)color_p);
g_dc.ops->setLayerConfig(&g_dc, 0, &fb_info);
DEMO_WaitBufferSwitchOff();
/* IMPORTANT!!!
* Inform the graphics library that you are ready with the flushing*/
lv_disp_flush_ready(disp_drv);
gets me one step ahead. Now the regions are updated at the right place with the right size but the rest of the display is black. So I see the updated smaller regions flashing on the TFT with the correct content for a blink of an eye.
Regards,
Rainer
Hi Edwin,
thanks for the quick response.
Theoretically, this instructs lvgl to do partial refresh. I am aware of that.
Practically, this puts a lot of garbage on the screen.
Did you ever try this?
Further, the use of defines for the panel height and widths and the "buffer" height and widths are ... confusing, to say the least.
I collected some excerpts of the demo code (lvgl_demo_benchmark_cm7) and added some questions and comments, see below.
Best regards,
Rainer
display_support.h
#define DEMO_PANEL_WIDTH (720)
#define DEMO_PANEL_HEIGHT (1280)
#define DEMO_BUFFER_WIDTH DEMO_PANEL_WIDTH
#define DEMO_BUFFER_HEIGHT DEMO_PANEL_HEIGHT
// ok so far. Buffers have same size as panel
display_support.c
static const dc_fb_lcdifv2_config_t s_dcFbLcdifv2Config = {
.lcdifv2 = DEMO_LCDIF,
.width = DEMO_PANEL_WIDTH,
.height = DEMO_PANEL_HEIGHT,
...
// ok, hardware properties
lvgl_support.h
#define LCD_WIDTH DEMO_BUFFER_WIDTH
#define LCD_HEIGHT DEMO_BUFFER_HEIGHT
#define LCD_FB_BYTE_PER_PIXEL DEMO_BUFFER_BYTE_PER_PIXEL
// These aren't used at all, only in emwin demos
lvgl_support.c
#define DEMO_FB_SIZE \
(((DEMO_BUFFER_WIDTH * DEMO_BUFFER_HEIGHT * LCD_FB_BYTE_PER_PIXEL) + DEMO_FB_ALIGN - 1) & ~(DEMO_FB_ALIGN - 1))
// So, reducing DEMO_BUFFER_HEIGHT and WIDTH should have an immediate effect, here
#define LVGL_BUFFER_WIDTH DEMO_BUFFER_WIDTH
#define LVGL_BUFFER_HEIGHT DEMO_BUFFER_HEIGHT
// what's the gain of adding another define, here?
lv_disp_draw_buf_init(&disp_buf, s_frameBuffer[0], s_frameBuffer[1], DEMO_BUFFER_WIDTH * DEMO_BUFFER_HEIGHT);
// that looks right to me. If I want to use a smaller buffer than fullsize, it's correclty initialized
g_dc.ops->getLayerDefaultConfig(&g_dc, 0, &fbInfo);
fbInfo.pixelFormat = DEMO_BUFFER_PIXEL_FORMAT;
fbInfo.width = DEMO_BUFFER_WIDTH;
fbInfo.height = DEMO_BUFFER_HEIGHT;
fbInfo.startX = DEMO_BUFFER_START_X;
fbInfo.startY = DEMO_BUFFER_START_Y;
// from the definition in fsl_dc_fb.h
typedef struct _dc_fb_info
{
uint16_t startX; /*!< The start position in the panel. */
uint16_t startY; /*!< The start position in the panel. */
uint16_t width; /*!< How many pixels in one line of the frame buffer.*/
// so, wouldn't this need to be updated with the actual position with every partial refresh?
/*Set the resolution of the display*/
disp_drv.hor_res = LVGL_BUFFER_WIDTH;
disp_drv.ver_res = LVGL_BUFFER_HEIGHT;
// so, this is the panel width, then, right? why LVGL_BUFFER?
data->point.x = touch_x * DEMO_PANEL_WIDTH / s_touchResolutionX;
data->point.y = touch_y * DEMO_PANEL_HEIGHT / s_touchResolutionY;
// this seems correct to me
Hi @hfuhruhurr,
Although we do not have any example code on how to do partiar refresh, it is possible by implementing the following change on lvgl_support.c:
disp_drv.full_refresh = 0
Let me know if you have further inquiries about this topic.
BR,
Edwin.