Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4d17659 authored by Hyesoo Yu's avatar Hyesoo Yu Committed by Hridya Valsaraju
Browse files

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: default avatarHyesoo Yu <hyesoo.yu@samsung.com>
Change-Id: Id5ca12ff120bfeac53a84ffad91e7a219e2180cd
(cherry picked from commit 16ce0bda52c9948d52e5676359b6cade2662580f)
Signed-off-by: default avatarHridya Valsaraju <hridya@google.com>
parent 7bbd50f1
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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)