Why does eglCreateContext allocate 9MB of video memory?

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

Why does eglCreateContext allocate 9MB of video memory?

跳至解决方案
1,337 次查看
stephenminutill
Contributor II

On i.MX6Q with Linux BSP 4.1.0 I am seeing 9MB of video memory allocated when eglCreateContext is called.  This is true in my own applications and in the SimpleTriangle example GLES2.0 program.  It is allocated in five 1MB chunks and then one 4MB chunk.  I can see this memory allocation by monitoring calls to gckVIDMEM_AllocateLinear.  What is the purpose of this memory allocation?  Is it possible to reduce or eliminate it?

标签 (3)
1 解答
980 次查看
asim_zaidi
NXP Employee
NXP Employee

I checked with the R & D team and they confirmed gpu-viv-bin-mx6q_4.0.0 will have the problem of using more memory just for creating context.

The latest driver(3.10.53_1.1.0 ) is 5.x based and supposed to take only 3MB.

Please test with the latest 5.x GPU driver

在原帖中查看解决方案

4 回复数
980 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Please check the board file for the GPU reserved memory?

For example on sabreSD, the following code is used to reserve gpu memory which is limited under 1G address.

Arch/arm/mach-mx6/board-mx6q_sabresd.c

if (imx6q_gpu_pdata.reserved_mem_size) {

phys = memblock_alloc_base(imx6q_gpu_pdata.reserved_mem_size,

SZ_4K, SZ_1G);

memblock_remove(phys, imx6q_gpu_pdata.reserved_mem_size);

imx6q_gpu_pdata.reserved_mem_base = phys;

}

FSL have some reserving memory for vpu and gpu in Android. Typically it should be 32M for VPU and 16-32M for gpu.

One thing to note is you have to set the size of pmem_gpu to be any size of order of 2. It should be 1M, 2M, 4M, 8M, 16M, 32M,….


Hope it helps!

0 项奖励
980 次查看
stephenminutill
Contributor II

By default on the SabreSD board imx6q_gpu_pdata.reserved_mem_size is 128M.  When using Wayland to run multiple graphical applications, that 9MB per process adds up quickly.  I would like to know what the purpose of the 9MB allocation is, and if it can be reduced?

0 项奖励
980 次查看
davebailey
Contributor I

HugoOsornio

Hugo,

Have you seen this issue and are you able to explain this allocation?  We are also see this on our design.

Thanks.

Dave

981 次查看
asim_zaidi
NXP Employee
NXP Employee

I checked with the R & D team and they confirmed gpu-viv-bin-mx6q_4.0.0 will have the problem of using more memory just for creating context.

The latest driver(3.10.53_1.1.0 ) is 5.x based and supposed to take only 3MB.

Please test with the latest 5.x GPU driver