From b70b46407b7ff9ae0d4233a8ba5375987c5053c8 Mon Sep 17 00:00:00 2001 From: Jianqun Xu Date: Sat, 26 Mar 2022 10:32:21 +0800 Subject: [PATCH] dma-buf: rk_heaps: cma heap enable 'cache_sgt_mapping' Enable the 'cache_sgt_mapping' for rk_cma_heap_buf_ops, to cache the first mapping made for each attachment. This avoids create mappings for attachments multiple times. By the way, cache the sgt can support debugfs to get the buffer information from scatterlists. Signed-off-by: Jianqun Xu Change-Id: Id822e3088af9eab5d88d0172c31191d2fc9d4151 --- drivers/dma-buf/rk_heaps/rk-cma-heap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma-buf/rk_heaps/rk-cma-heap.c b/drivers/dma-buf/rk_heaps/rk-cma-heap.c index 47ee96121504..1010d33c57c1 100644 --- a/drivers/dma-buf/rk_heaps/rk-cma-heap.c +++ b/drivers/dma-buf/rk_heaps/rk-cma-heap.c @@ -416,6 +416,7 @@ static void rk_cma_heap_dma_buf_release(struct dma_buf *dmabuf) } static const struct dma_buf_ops rk_cma_heap_buf_ops = { + .cache_sgt_mapping = true, .attach = rk_cma_heap_attach, .detach = rk_cma_heap_detach, .map_dma_buf = rk_cma_heap_map_dma_buf,