ANDROID: dma-heap: Let system heap report total pool size
This information will be exposed as part of Android Bugreport[1]. [1]: https://android-review.googlesource.com/q/topic:%22b%252F167709539%22+(status:open%20OR%20status:merged) Bug: 167709539 Change-Id: I5b810bd18a495fe8e7f4907c047917ba4718796d Signed-off-by: Hridya Valsaraju <hridya@google.com>
This commit is contained in:
parent
196f1975a8
commit
1099a4407d
1 changed files with 16 additions and 0 deletions
|
|
@ -500,8 +500,24 @@ static struct dma_buf *system_heap_allocate(struct dma_heap *heap,
|
|||
return system_heap_do_allocate(heap, len, fd_flags, heap_flags, false);
|
||||
}
|
||||
|
||||
static long system_get_pool_size(struct dma_heap *heap)
|
||||
{
|
||||
int i;
|
||||
long num_pages = 0;
|
||||
struct dmabuf_page_pool **pool;
|
||||
|
||||
pool = pools;
|
||||
for (i = 0; i < NUM_ORDERS; i++, pool++) {
|
||||
num_pages += ((*pool)->count[POOL_LOWPAGE] +
|
||||
(*pool)->count[POOL_HIGHPAGE]) << (*pool)->order;
|
||||
}
|
||||
|
||||
return num_pages << PAGE_SHIFT;
|
||||
}
|
||||
|
||||
static const struct dma_heap_ops system_heap_ops = {
|
||||
.allocate = system_heap_allocate,
|
||||
.get_pool_size = system_get_pool_size,
|
||||
};
|
||||
|
||||
static struct dma_buf *system_uncached_heap_allocate(struct dma_heap *heap,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue