LCDIFv2 Multilayer Size Problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LCDIFv2 Multilayer Size Problem

3,404 次查看
gokhannsahin
Contributor II

Hi everyone,

I have a project using a multilayer with LVGL. LCDIFv2 alpha blending mode is set embedded alpha for 3 layers and pixel formats of each layer are ARGB8888-32bit. When increased any layer's width, the screen is beginning to mix. Is there any restriction to set the layer's width for multilayer with alpha blending?

Buffers;

 

SDK_ALIGN(static uint8_t s_fb_layer_1[2][__GET_FB_SIZE(k_LAYER1_SCREEN_WIDTH,k_LAYER1_SCREEN_HEIGHT)],  \
		LV_ATTRIBUTE_MEM_ALIGN_SIZE);
SDK_ALIGN(static uint8_t s_fb_layer_2[2][__GET_FB_SIZE(k_LAYER2_SCREEN_WIDTH,k_LAYER2_SCREEN_HEIGHT)],  \
		LV_ATTRIBUTE_MEM_ALIGN_SIZE);
SDK_ALIGN(static uint8_t s_fb_layer_3[2][__GET_FB_SIZE(k_LAYER3_SCREEN_WIDTH,k_LAYER3_SCREEN_HEIGHT)],  \
		LV_ATTRIBUTE_MEM_ALIGN_SIZE);

SDK_ALIGN(static uint32_t s_lcdif2_buf_layer_1[k_LAYER1_SCREEN_WIDTH*k_LAYER1_SCREEN_HEIGHT], \
		LV_ATTRIBUTE_MEM_ALIGN_SIZE);
SDK_ALIGN(static uint32_t s_lcdif2_buf_layer_2[k_LAYER2_SCREEN_WIDTH*k_LAYER2_SCREEN_HEIGHT], \
		LV_ATTRIBUTE_MEM_ALIGN_SIZE);
SDK_ALIGN(static uint32_t s_lcdif2_buf_layer_3[k_LAYER3_SCREEN_WIDTH*k_LAYER3_SCREEN_HEIGHT], \
		LV_ATTRIBUTE_MEM_ALIGN_SIZE);

 

No problem layer dimensions;

 

#define k_LAYER1				(0U)
#define k_LAYER1_SCREEN_WIDTH	(1024U)
#define k_LAYER1_SCREEN_HEIGHT	(600U)
#define k_LAYER1_SCREEN_START_X	(0U)
#define k_LAYER1_SCREEN_START_Y	(0U)

#define k_LAYER2				(1U)
#define k_LAYER2_SCREEN_WIDTH	(338U)
#define k_LAYER2_SCREEN_HEIGHT	(339U)
#define k_LAYER2_SCREEN_START_X	(58U)
#define k_LAYER2_SCREEN_START_Y	(146U)

#define k_LAYER3				(2U)
#define k_LAYER3_SCREEN_WIDTH	(338U)
#define k_LAYER3_SCREEN_HEIGHT	(339U)
#define k_LAYER3_SCREEN_START_X	(638U)
#define k_LAYER3_SCREEN_START_Y	(146U)

 

 Mixing screen layer dimensions;

 

#define k_LAYER1				(0U)
#define k_LAYER1_SCREEN_WIDTH	(1024U)
#define k_LAYER1_SCREEN_HEIGHT	(600U)
#define k_LAYER1_SCREEN_START_X	(0U)
#define k_LAYER1_SCREEN_START_Y	(0U)

#define k_LAYER2				(1U)
#define k_LAYER2_SCREEN_WIDTH	(800U)
#define k_LAYER2_SCREEN_HEIGHT	(600U)
#define k_LAYER2_SCREEN_START_X	(0U)
#define k_LAYER2_SCREEN_START_Y	(0U)

#define k_LAYER3				(2U)
#define k_LAYER3_SCREEN_WIDTH	(512U)
#define k_LAYER3_SCREEN_HEIGHT	(600U)
#define k_LAYER3_SCREEN_START_X	(512U)
#define k_LAYER3_SCREEN_START_Y	(0U)

 

 

标签 (1)
标记 (1)
0 项奖励
回复
13 回复数

3,393 次查看
gokhannsahin
Contributor II

I will check this, also, I'm wondering how to make alpha blending with layer 0 - RGB565, layer 1 - ARGB8888, and layer 2 - RGB565 in order to reduce memory.

I'm thinking of using VGlite in layer 1 and others are LVGLs.

0 项奖励
回复

3,391 次查看
Aubineau_FAE
NXP Employee
NXP Employee

hi,

RGB565 has no alpha channel compared to RGB8888

What kind of picture do you display? what about using a LUT with alpha channel in the color encoding (256 colors encoded in 32bpp), you'll save 75% of bandwidth in this case compared to RGB8888 full layer?

Vincent

0 项奖励
回复

3,383 次查看
gokhannsahin
Contributor II

I know that but LVGL supports only for RBG565 or ARGB8888. Also, it is very hungry performance while rotating. So, decided using vglite in another layer independent of LVGL. It gives very good performance but can’t make alpha blending between these layer because LVGLs’ don’t have alpha value in RGB565. After that changed to ARGB8888 this time needs lots of memory and can’t blend them because of size. What is blending limit of LCDIF or is there a limit?

resolution : 1024x600 and 25FPS

0 项奖励
回复

3,376 次查看
Aubineau_FAE
NXP Employee
NXP Employee

Hi,

What kind of rotation are you doing? 90°/180°/270° or arbitrary? if so, use the PXP with handshaking in internal RAM for that for one layer.

I don't have the figures for the max blending capabilities as it also depends on your SDRAM traffic.

But in your case, assuming 60Hz screen, you'll have:

- 1024*600*32BPP*3layers*60Hz # 442MB/s just for the refresh

- 1024*600*32BPP*3layers*25Hz # 184MB/s to write your layers BUT I don't count the extra SDRAM accesses to generate it.

What is your SDRAM frequency and buswidth?

Do you access non-cached SDRAM region with the M7?

You software run in SDRAM, TCM, OCRAM or NOR Flash?

Vincent

3,370 次查看
gokhannsahin
Contributor II

I don't use any rotation. Actually, I'm using an HDMI screen so don't know looking which one parameter for refresh rate (MIPI, LCDIF, or HDMI). I found a black hole since this resolution is not standard for HDMI and can see 1024x600x72Hz on the LCD.

SDRAM bandwidth is 32bit and runs 200MHz. My code is running on OCRAM and some functions which need speed or calling a lot are in ITCM. Finally, buffers are in non-cacheable memory in the last of SDRAM.

By the way, I checked the underrun flag, you are right, it happens.

0 项奖励
回复

3,360 次查看
Aubineau_FAE
NXP Employee
NXP Employee

Hi,

72MHz seems quite high for 25fps update.

What you can also do, is blending the 2 bottom layers in a RGB layer with the PXP (RGBA+RGBA -> RGB).

Regarding your resolution it should work, thus you'll blend a RGBA layer and a RGB layer.

On my EVK I have already tested 1280x720@60Hz RGBA+RGB+1BPP blending with the eLCDIFv2.

/BR

Vincent

3,351 次查看
gokhannsahin
Contributor II

Thank you very much.

Do you know any method setting parameters for non-standard HDMI resolution? If yes, how?

Also, which one frequency determines the refresh rate in case of using lcdifv2 and MIPI-DSI to HDMI?

I don't have any idea about using PXP for blending ARGB+ARGB = RGB, what is its mode? Is there any example?

By the way, I can not find SVG to Elementary tool in the application note graphics pipeline. How can I get it?

0 项奖励
回复

3,341 次查看
Aubineau_FAE
NXP Employee
NXP Employee

Hi,

the LCDIFv2 pixel clock is generated with the LVDIFv2 clock root.

In your case you have to configure also certainly all the display parameter (front/back porch, hsync, vsync, etc...)

I have enclosed an example for the PXP offline blending.

It is based on the SDK 2.10.1, LCDIFv2 blend example. I tested it with IAR compiler. You need to increase the size of the non-cacheable memory as you have more buffers for the test.

I display it on an 1280x720 display @ 60Hz.

I have 3x 600x1024 ARGB plane in SDRAM (different size chessmate with alpha transparency)

vincent_aubinea_0-1644486220713.png

I blend 2x RGBA buffer in RGB with the PXP (offline blending):

vincent_aubinea_1-1644487124211.png

With the LCDIFv2 I blend the latest RGBA  layer & the RGB layer generated by the PXP:

vincent_aubinea_2-1644487285722.png

PXP blending lasts around 27ms (#37fps), and if you use the PXP with 16pix*16pix transfers (8*8 in the current sw)  you go down to #20ms (50fps):

in PXP_APP_init:

PXP_SetProcessBlockSize(APP_PXP, kPXP_BlockSize16); // AUBINEAU 16pix block size --> gain is from #37fps to #50fps!

/BR

Vincent

 

3,327 次查看
gokhannsahin
Contributor II

Thank you very much, it is a great example.

However, I have problem about it, I have two diffrent buffer like below;

buf1 = ARGB8888 and buf1[0] = 0xFB0000AA

buf2 = ARGB8888 and buf2[0] = 0x00000000

I tried to blend them in your example and the result was as I didn't expect. 

outbuf[0] = 0x000000AA, although the first pixel is not transparent after blended it becomes transparent. why? My expected result is output[0] = 0xFB0000AA. Do I need to use another PXP mode such as porter duff, copy picture, etc.?

Another question about VGLite, can the path be undone after it's drawn in the buffer? (only path, not clean a rect or full buffer)Is there any method? Also, I need to use your "SVG to elementary tool" to convert the bitmap to an array but it is not given by NXP on the website? 

0 项奖励
回复

3,388 次查看
Aubineau_FAE
NXP Employee
NXP Employee

and what is the resolution of your screen & refresh rate?

BR

Vincent

标记 (1)
0 项奖励
回复

3,398 次查看
Aubineau_FAE
NXP Employee
NXP Employee

Hi,

 

Check you don't have a memory underrun.

See INT_ENABLE_Dx / INT_STATUS_Dx registers.

If you have a memory underrun, reduce the BPP for instance (especially the lowest layer does not need transparency in general) or use a LUT.

Vincent

2,756 次查看
CamillePC
Contributor I

hi, 

I want use lvgl and vglite, lcdifv2 to view multi layer. Can you give me example of multi layer? 

Thank you very much. 

0 项奖励
回复

2,745 次查看
Aubineau_FAE
NXP Employee
NXP Employee

Hi,

In the Software SDK you have LCDIFv2 multilayer example:

vincent_aubinea_0-1668514325012.png

Regards,

Vincent

 

0 项奖励
回复