diff options
author | Rebecca Schultz Zavin | 2013-12-13 23:23:59 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2013-12-14 17:55:38 +0100 |
commit | 708f0cac89d00c366d562265e0b0244cda6f903d (patch) | |
tree | a7a671a2c0d9fd86cead38b75fb2a475bddba76e /drivers/staging/android/ion/ion_system_heap.c | |
parent | gpu: ion: Only map as much of the vma as the user requested (diff) | |
download | kernel-qcow2-linux-708f0cac89d00c366d562265e0b0244cda6f903d.tar.gz kernel-qcow2-linux-708f0cac89d00c366d562265e0b0244cda6f903d.tar.xz kernel-qcow2-linux-708f0cac89d00c366d562265e0b0244cda6f903d.zip |
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.
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
[jstultz: modified patch to apply to staging directory]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android/ion/ion_system_heap.c')
-rw-r--r-- | drivers/staging/android/ion/ion_system_heap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index 7397bc41fb45..2fb9a6497089 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/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; } |