ANDROID: staging: ion: use dma_[un]map_sg_attrs

The [un]map_dma_buf receives dma_buf_attachment by
parameter. The caller could set the dma_map_attrs
on dma_buf_attachment such as DMA_ATTR_SKIP_CPU_SYNC,
and expects that attributes are applied.
The dma_[un]map_sg is changed into dma_[un]map_sg_attrs
to send the attributes.

Bug: 151775080

Signed-off-by: Hyesoo Yu <hyesoo.yu@samsung.com>
Change-Id: Id5ca12ff120bfeac53a84ffad91e7a219e2180cd
(cherry picked from commit 16ce0bda52c9948d52e5676359b6cade2662580f)
Signed-off-by: Hridya Valsaraju <hridya@google.com>
This commit is contained in:
Hyesoo Yu 2020-04-01 19:26:58 +09:00 • committed by Hridya Valsaraju
commit d4d1765952

View file

@ -111,7 +111,8 @@ static struct sg_table *ion_map_dma_buf(struct dma_buf_attachment *attachment,
a = attachment->priv;
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, attachment->dma_map_attrs))
return ERR_PTR(-ENOMEM);
return table;
@ -128,7 +129,8 @@ static void ion_unmap_dma_buf(struct dma_buf_attachment *attachment,
return heap->buf_ops.unmap_dma_buf(attachment, table,
direction);
dma_unmap_sg(attachment->dev, table->sgl, table->nents, direction);
dma_unmap_sg_attrs(attachment->dev, table->sgl, table->nents,
direction, attachment->dma_map_attrs);
}
static void ion_dma_buf_release(struct dma_buf *dmabuf)