Hello I am working the the DM8168 EZSDK 5_3_1_15. My goal is to allocate as much memory as possible into CMEM that will be accessible by the VPSS core. I need to allocate as many 1080p (1920*1080*2 byte) buffers as possible. I am working on a custom board with 2GB of memory. Here is the issue that i am seeing.
Currently i am trying to allocate 324MB of memory in the LINUX2 portion of the memory map and then another 512MB in the bottom half of the second GB that the board provides. Ideally these parameters would work:
insmod /lib/modules/2.6.37/kernel/drivers/dsp/cmemk.ko pools=81x4147200 phys_start=0x9F900000 phys_end=0xB3D00000,
phys_start_1=0xC0000000 phys_end_1=0xE0000000 pools=128x4147200 allowOverlap=1
When i try to do this it fails with:
CMEMK Error: Failed to find a big enough free block
CMEMK Error: alloc_pool failed to get contiguous area of size 4149248
CMEMK Error: Failed to alloc pool of size 4147200 and number of buffers 128
insmod: error inserting '/lib/modules/2.6.37/kernel/drivers/dsp/cmemk.ko': -1 Cannot allocate memory
I realize that it has to round up a little for each pool to reach a certain byte boundary but there should still be enough room to do this.
Even more interesting is that the maximum it will let me allocate for the second segment of memory is 81 pools,
the same as the first segment of memory. Making my parameters this:
insmod /lib/modules/2.6.37/kernel/drivers/dsp/cmemk.ko pools=81x4147200 phys_start=0x9F900000 phys_end=0xB3D00000,
phys_start_1=0xC0000000 phys_end_1=0xE0000000 pools=81x4147200 allowOverlap=1
So this works. Is there a dependency/bug reguarding the number of pools in the second segment of memory that it cannot be higher than the first?
Yet another problem that i found was when i went to use these pools of memory. Here is how i am allocating the buffers in user space:
memParams.type=CMEM_POOL;
memParams.flags=CMEM_CACHED;
memParams.alignment=NULL; //not used for pool allocations;
for(i=0;i<100;i++){
buffer_addr[i]= CMEM_alloc(1920*1080*2,&memParams);
if(buffer_addr[i] == NULL){
failedBuffers++;
}
}
When i do this, I can only allocate 81 buffers! It starts to error out after that.
it is like it does not know about the second set of 81 buffers i set up in cmem.
Any insight as to why the above to problems are happening.
Thanks,
Ben