From 83065feb357fa293f5ac4a082ee112a471930465 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Sat, 24 Sep 2022 09:17:49 +0800 Subject: [PATCH] Revert "ANDROID: dma-buf: system_heap: allocate from dma32_pool for dma32* heap" This reverts commit 383018f42d4d3ee0ecb8d3d424db04e7fa6de4a2. Use rk_system_heap.c instead of system_heap.c now, reverts all changes. Signed-off-by: Tao Huang Change-Id: I27099b713ac3249acb628868c7255c51b2881371 --- drivers/dma-buf/heaps/system_heap.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c index 2a3872d06978..3c348c755004 100644 --- a/drivers/dma-buf/heaps/system_heap.c +++ b/drivers/dma-buf/heaps/system_heap.c @@ -519,22 +519,18 @@ static const struct dma_buf_ops system_heap_buf_ops = { .release = system_heap_dma_buf_release, }; -static struct page *system_heap_alloc_largest_available(struct dma_heap *heap, - unsigned long size, - unsigned int max_order) +static struct page *alloc_largest_available(unsigned long size, + unsigned int max_order) { struct page *page; int i; - const char *name = dma_heap_get_name(heap); - struct dmabuf_page_pool **pool; - pool = strstr(name, "dma32") ? dma32_pools : pools; for (i = 0; i < NUM_ORDERS; i++) { if (size < (PAGE_SIZE << orders[i])) continue; if (max_order < orders[i]) continue; - page = dmabuf_page_pool_alloc(pool[i]); + page = dmabuf_page_pool_alloc(pools[i]); if (!page) continue; return page; @@ -587,7 +583,7 @@ static struct dma_buf *system_heap_do_allocate(struct dma_heap *heap, if (fatal_signal_pending(current)) goto free_buffer; - page = system_heap_alloc_largest_available(heap, size_remaining, max_order); + page = alloc_largest_available(size_remaining, max_order); if (!page) goto free_buffer;