imx6-vpu-memeory If it exceeds 30M, it will be wrong

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6-vpu-memeory If it exceeds 30M, it will be wrong

612 Views
48954201
Contributor I

Hello,

I am now allocating memory to vpu. If it exceeds 30M, it will be wrong. Is there little physical memory reserved for vpu? What's the problem? Thank you

test demo

//------------------------------------------------------------------------------------------

int main(int argc, char** argv)
{
if (argc < 2) {
printf("input IOGetPhyMem size");
fflush(stdout);
}
int size = atoi(argv[1]);

vpu_Init(NULL);

vpu_mem_desc m_decMemDesc;
memset(&m_decMemDesc, 0, sizeof(m_decMemDesc));

m_decMemDesc.size = size;

int ret = IOGetPhyMem(&m_decMemDesc);
if (ret) {
printf("Unable to obtain physical mem, size : %d\n", size);
fflush(stdout);
return -1;
} else {
printf("obtain physical mem success, size : %d\n", size);
fflush(stdout);
IOFreePhyMem(&m_decMemDesc);
return 0;
}
}

[root@EmbedSky testvpu-mem]# ./fbtest 41943040
------------[ cut here ]------------
WARNING: at mm/page_alloc.c:2121 __alloc_pages_nodemask+0x1dc/0x780()
Modules linked in:

[<c0247970>] (unwind_backtrace+0x0/0x138) from [<c0278908>] (warn_slowpath_common+0x4c/0x64)
[<c0278908>] (warn_slowpath_common+0x4c/0x64) from [<c027893c>] (warn_slowpath_null+0x1c/0x24)

[<c027893c>] (warn_slowpath_null+0x1c/0x24) from [<c02e737c>] (__alloc_pages_nodemask+0x1dc/0x780)
[<c02e737c>] (__alloc_pages_nodemask+0x1dc/0x780) from [<c024aa50>] (__dma_alloc+0xa0/0x2fc)

[<c024aa50>] (__dma_alloc+0xa0/0x2fc) from [<c024b288>] (dma_alloc_coherent+0x54/0x60)
[<c024b288>] (dma_alloc_coherent+0x54/0x60) from [<c05cd4ac>] (vpu_alloc_dma_buffer+0x2c/0x84)

[<c05cd4ac>] (vpu_alloc_dma_buffer+0x2c/0x84) from [<c05cd698>] (vpu_ioctl+0x194/0x924)
[<c05cd698>] (vpu_ioctl+0x194/0x924) from [<c03275b8>] (do_vfs_ioctl+0x80/0x54c)

[<c03275b8>] (do_vfs_ioctl+0x80/0x54c) from [<c0327abc>] (sys_ioctl+0x38/0x5c)
[<c0327abc>] (sys_ioctl+0x38/0x5c) from [<c0240940>] (ret_fast_syscall+0x0/0x30)

---[ end trace 6af12b6afc3bea02 ]---
Physical memory allocation error!
Physical memory allocation error!
[ERR] mem allocation failed!
Unable to obtain physical mem, size : 41943040
[root@EmbedSky testvpu-mem]#

why IOGetPhyMem error ? 

Labels (2)
0 Kudos
1 Reply

474 Views
igorpadykov
NXP Employee
NXP Employee

Hi jh

may be useful to look at vpu memory usage described on

Memory Reserved on i.MX6 for VPU 

https://community.nxp.com/docs/DOC-93591 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos