Hi,
I am a beginner of Davinci.
I want to talk about my simple understanding of Davinci Memory.
Please feel free to tell me my mistakes or your opinion.
There are 3 parts in Davinci Memory.
Linux memory (ARM) + Share memory (Cmem) + DSP memory
We can use malloc in ARM application code to get Linux memory, which is virtual memory and discontinuous memory.
It is managed by Linux OS, and can be changed when the board boot. (u-boot ?)
Because it's discontinuous, DSP can not use it.
So we need a shared memory which ARM and DSP can access it both.
There is a cmem module in Linux, we can change the size of share memory, and make some pools.
Applications in ARM side can use Memory_alloc to get memory, DSP maybe also can use that function?
DSP memory is set by BIOS. DSTK2 in FC manage the memory for algos in DSP side.
There are Algalloc and Algfree API in Codec examples, we can make more memtabs to get more memory for algo.
In your code you just need to assign the memtabs to your pointers before you use them.
But I think this method can not alloc memories dynamically.
Also, If the memory is just a temp memory used only in one codec.
You can use malloc or MEM_alloc to get memory from the heap managed by BIOS.(I am not sure).
It will work because malloc get memory from different heaps, on my board C6A8168 is "DDR2_HEAP" and "DDRALG_HEAP".
I think there are lots of mistakes in my understanding, Davinci memory system should be more complex than this.
Any opinions will be greatly appreciated.
Thank you.
yours ,
wang