From 33cea312509e0a4324dde5d45e4e05dd867fa2bf Mon Sep 17 00:00:00 2001 From: "hyesoo.yu" Date: Wed, 2 May 2018 16:12:25 +0900 Subject: [PATCH] media: vb2: replace iovmm api supported by ion The iovmm api doesn't support system MMU mapping of protected buffer. It is supported in exynos ion side. We replace iovmm api to support protected buffer. Change-Id: Ie6fe3f0fc2c877b31f0b7be7f23fe4492049a019 Signed-off-by: hyesoo.yu --- drivers/media/v4l2-core/videobuf2-dma-sg.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c b/drivers/media/v4l2-core/videobuf2-dma-sg.c index 1b1a45224b4c..3c36d19a1e35 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-sg.c +++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -581,12 +582,12 @@ static int vb2_dma_sg_map_dmabuf(void *mem_priv) if (device_get_dma_attr(buf->dev) == DEV_DMA_COHERENT) ioprot |= IOMMU_CACHE; - buf->iova = iovmm_map(buf->dev, sgt->sgl, 0, buf->size, + buf->iova = ion_iovmm_map(buf->db_attach, 0, buf->size, DMA_BIDIRECTIONAL, ioprot); if (IS_ERR_VALUE(buf->iova)) { dma_buf_unmap_attachment(buf->db_attach, sgt, buf->dma_dir); - pr_err("Error from iovmm_map()=%pad\n", &buf->iova); + pr_err("Error from ion_iovmm_map()=%pad\n", &buf->iova); return (int)buf->iova; } } @@ -629,7 +630,7 @@ static void vb2_dma_sg_detach_dmabuf(void *mem_priv) if (WARN_ON(buf->dma_sgt)) vb2_dma_sg_unmap_dmabuf(buf); - iovmm_unmap(buf->dev, buf->iova); + ion_iovmm_unmap(buf->db_attach, buf->iova); /* detach this attachment */ dma_buf_detach(buf->db_attach->dmabuf, buf->db_attach); -- 2.20.1