[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220608060755.2213-3-irui.wang@mediatek.com>
Date: Wed, 8 Jun 2022 14:07:55 +0800
From: Irui Wang <irui.wang@...iatek.com>
To: Hans Verkuil <hverkuil-cisco@...all.nl>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Tzung-Bi Shih <tzungbi@...omium.org>
CC: <Project_Global_Chrome_Upstream_Group@...iatek.com>,
<linux-media@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
Tomasz Figa <tfiga@...omium.org>, <xia.jiang@...iatek.com>,
<maoguang.meng@...iatek.com>, kyrie wu <kyrie.wu@...iatek.com>,
<srv_heupstream@...iatek.com>
Subject: [V2,2/2] media: media: jpegenc: set bit mask for jpegenc
From: kyrie wu <kyrie.wu@...iatek.com>
set jpeg encode DMA bit mask to support 34bits
iova space(16GB) that the mt8186 iommu HW support.
Whole the iova range separate to 0~4G/4G~8G/8G~12G/12G~16G,
regarding which iova range jpgenc actually locate, it
depends on the dma-ranges property of vdec dtsi node.
Signed-off-by: kyrie wu <kyrie.wu@...iatek.com>
---
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
index bc5b0a0168ec..87685a62a5c2 100644
--- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
@@ -1369,6 +1369,9 @@ static int mtk_jpeg_probe(struct platform_device *pdev)
jpeg->vdev->device_caps = V4L2_CAP_STREAMING |
V4L2_CAP_VIDEO_M2M_MPLANE;
+ if (of_get_property(pdev->dev.of_node, "dma-ranges", NULL))
+ dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(34));
+
ret = video_register_device(jpeg->vdev, VFL_TYPE_VIDEO, -1);
if (ret) {
v4l2_err(&jpeg->v4l2_dev, "Failed to register video device\n");
--
2.18.0
Powered by blists - more mailing lists