mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
android: ion: pass in DMA_ATTR_SKIP_CPU_SYNC when calling dma_(un)map_sg_attrs()
Imitate the behaviors of drm_gem_map_detach() and drm_gem_map_dma_buf(). Graphics performance of rk3399 device using ion without this modification, was quite poor. Change-Id: Ia0b8e2f3026a61ee4addee9c1715291886fa1c99 Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
This commit is contained in:
@@ -276,8 +276,11 @@ static struct sg_table *ion_map_dma_buf(struct dma_buf_attachment *attachment,
|
||||
|
||||
table = a->table;
|
||||
|
||||
if (!dma_map_sg(attachment->dev, table->sgl, table->nents,
|
||||
direction))
|
||||
if (!dma_map_sg_attrs(attachment->dev,
|
||||
table->sgl,
|
||||
table->nents,
|
||||
direction,
|
||||
DMA_ATTR_SKIP_CPU_SYNC))
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
a->mapped = true;
|
||||
@@ -293,7 +296,11 @@ static void ion_unmap_dma_buf(struct dma_buf_attachment *attachment,
|
||||
|
||||
a->mapped = false;
|
||||
|
||||
dma_unmap_sg(attachment->dev, table->sgl, table->nents, direction);
|
||||
dma_unmap_sg_attrs(attachment->dev,
|
||||
table->sgl,
|
||||
table->nents,
|
||||
direction,
|
||||
DMA_ATTR_SKIP_CPU_SYNC);
|
||||
}
|
||||
|
||||
static int ion_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma)
|
||||
|
||||
Reference in New Issue
Block a user