From: hyesoo.yu Date: Wed, 2 May 2018 07:12:25 +0000 (+0900) Subject: media: vb2: replace iovmm api supported by ion X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=33cea312509e0a4324dde5d45e4e05dd867fa2bf;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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);