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 <jay.xu@rock-chips.com>
Change-Id: Id822e3088af9eab5d88d0172c31191d2fc9d4151
This commit is contained in:
Jianqun Xu
2022-03-26 10:32:21 +08:00
committed by Tao Huang
parent c63b9bb07c
commit b70b46407b

View File

@@ -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,