On Tue, Sep 4, 2012 at 12:51 PM, zhangfei gao zhangfei.gao@gmail.com wrote:
On Mon, Sep 3, 2012 at 2:23 PM, Nishanth Peethambaran nishanth.peethu@gmail.com wrote:
Rebecca has already updated heap_show to show the orphaned buffers. This patch won't apply on top of it.
For our need, I have updated the heap_show() and heap_total() functions to account the heap usage per heap->id instead of heap->type. I had posted a patch also for that. There can be multiple
Does the patch for id has been merged ?
No. I did not see any response :)
heaps of same type. Use-cases are to map read buffer in sdram bank0 and write buffer in sdram bank1. Or to have small dedicated carveout heap for camera use-case which we don't want to fail or get delayed because of cma migration failures/retries.
I am afraid this can not be achieved in existing ion.c, where only heap->id is used.
ion_alloc /* if the client doesn't support this heap type */ if (!((1 << heap->type) & client->heap_mask)) continue; /* if the caller didn't specify this heap type */ if (!((1 << heap->id) & heap_mask)) continue;
The client->heap_mask is -1 and heap->type does not used at all. ion_open -> ion_client_create(dev, -1, "user") -> client->heap_mask = heap_mask;
Besides, ion_allocation_data only have vector heap_mask, how to use both id and type?
The client->heap_mask is -1 for user-code which means all 16 possible heap-ids are valid. The user can select the required heap based on heap_mask passed when calling the "alloc" api/ioctl. So if you have two carveout/CMA areas, define them as of same type and different id in the platform_heap. Then, use the appropriate bitmask in heap_mask while allocating for selecting the right heap. Eg: CMA0 is id 0 and CMA1 is id 1. Then heap_mask of 1 will try only from CMA0. heap_mask of 2 will try only from CMA1. heap_mask of 3 will try CMA0 first and then CMA1.