From 23cdadf8a5c2e6b12764fea4d6c38f4be21ea2b6 Mon Sep 17 00:00:00 2001 From: Jianqun Xu Date: Mon, 26 Sep 2022 14:46:08 +0800 Subject: [PATCH] Revert "dma-buf: dma-heap: heap ops supports get_phys" This partially reverts commit 61a32e157ecef6732df9bf400c2da29e8f3df390. Convert to use rk_cma_heap.c and keep fixes to dma-heap.c Signed-off-by: Jianqun Xu Change-Id: I740d0de75d8b526f7de987b0b1c18dc3f6298705 --- drivers/dma-buf/heaps/cma_heap.c | 35 -------------------------------- 1 file changed, 35 deletions(-) diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c index ab6f937eb60d..2c0ba561957c 100644 --- a/drivers/dma-buf/heaps/cma_heap.c +++ b/drivers/dma-buf/heaps/cma_heap.c @@ -21,7 +21,6 @@ #include #include #include -#include struct cma_heap { @@ -441,42 +440,8 @@ static struct dma_buf *cma_heap_allocate(struct dma_heap *heap, return cma_heap_do_allocate(heap, len, fd_flags, heap_flags, false); } -static int cma_heap_get_phys(struct dma_heap *heap, - struct dma_heap_phys_data *phys) -{ - struct cma_heap *cma_heap = dma_heap_get_drvdata(heap); - struct cma_heap_buffer *buffer; - struct dma_buf *dmabuf; - - phys->paddr = (__u64)-1; - - if (IS_ERR_OR_NULL(phys)) - return -EINVAL; - - dmabuf = dma_buf_get(phys->fd); - if (IS_ERR_OR_NULL(dmabuf)) - return -EBADFD; - - buffer = dmabuf->priv; - if (IS_ERR_OR_NULL(buffer)) - goto err; - - if (buffer->heap != cma_heap) - goto err; - - phys->paddr = page_to_phys(buffer->cma_pages); - -err: - dma_buf_put(dmabuf); - - return (phys->paddr == (__u64)-1) ? -EINVAL : 0; -} - static const struct dma_heap_ops cma_heap_ops = { .allocate = cma_heap_allocate, -#if IS_ENABLED(CONFIG_NO_GKI) - .get_phys = cma_heap_get_phys, -#endif }; static struct dma_buf *cma_uncached_heap_allocate(struct dma_heap *heap,