diff options
author | Rebecca Schultz Zavin <rebecca@android.com> | 2012-08-21 21:35:20 -0700 |
---|---|---|
committer | Arve Hjønnevåg <arve@android.com> | 2013-07-01 14:16:04 -0700 |
commit | 9993b96e30cebbbfdce64775876ae7338bcfc10d (patch) | |
tree | 7e720e9fd20dcf347e9c03d21316c97a4cfc5bb0 /drivers/gpu | |
parent | e91e991e13b07f0666cb0eea1d00da65c478f9cf (diff) |
gpu: ion: Switch to using kmalloc rather than kmap during allocation
Previously, metadata was stored in the allocated pages themselves
during allocation. However the system can only have a limited
number of kmapped pages. A very large allocation might exceed
this limit.
Change-Id: Ibe972096e83924bf5e621d8282c4cd133ca75b0a
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/ion/ion_system_heap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/ion/ion_system_heap.c b/drivers/gpu/ion/ion_system_heap.c index e7fb07d45a2..ca6de04f6c2 100644 --- a/drivers/gpu/ion/ion_system_heap.c +++ b/drivers/gpu/ion/ion_system_heap.c @@ -46,7 +46,7 @@ static struct page_info *alloc_largest_available(unsigned long size) if (!page) continue; split_page(page, orders[i]); - info = kmap(page); + info = kmalloc(sizeof(struct page_info *), GFP_KERNEL); info->page = page; info->order = orders[i]; return info; @@ -93,7 +93,7 @@ static int ion_system_heap_allocate(struct ion_heap *heap, } list_del(&info->list); memset(info, 0, sizeof(struct page_info)); - kunmap(page); + kfree(info); } dma_sync_sg_for_device(NULL, table->sgl, table->nents, @@ -107,7 +107,7 @@ err: list_for_each_entry(info, &pages, list) { for (i = 0; i < (1 << info->order); i++) __free_page(info->page + i); - kunmap(info->page); + kfree(info); } return -ENOMEM; } |