aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrui Wang <irui.wang@mediatek.com>2021-06-05 10:29:15 +0800
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-06-14 12:22:44 +0200
commit8330bd26cda24d1c9ca5c1fd86912e298c834834 (patch)
tree8ab7dc496e673a59b288f02ca2b3360df970f6a0
parent204aef4b894edc602acc3a93b6eff2e5b6b996a3 (diff)
media: mtk-vcodec: Support 34bits dma address for venc
Use the dma_set_mask_and_coherent helper to set venc DMA bit mask to support 34bits iova space(16GB) that the mt8192 iommu HW support. Whole the iova range separate to 0~4G/4G~8G/8G~12G/12G~16G, regarding which iova range VENC actually locate, it depends on the dma-ranges property of venc dtsi node. Signed-off-by: Irui Wang <irui.wang@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
index 7d7b8cfc2cc5..26b089e81213 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
@@ -361,6 +361,9 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
goto err_event_workq;
}
+ 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(vfd_enc, VFL_TYPE_VIDEO, 1);
if (ret) {
mtk_v4l2_err("Failed to register video device");

Privacy Policy