Commit c2c3bde0 authored by Irui Wang's avatar Irui Wang Committed by Mauro Carvalho Chehab

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: default avatarIrui Wang <irui.wang@mediatek.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 5cd57605
...@@ -361,6 +361,9 @@ static int mtk_vcodec_probe(struct platform_device *pdev) ...@@ -361,6 +361,9 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
goto err_event_workq; 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); ret = video_register_device(vfd_enc, VFL_TYPE_VIDEO, 1);
if (ret) { if (ret) {
mtk_v4l2_err("Failed to register video device"); mtk_v4l2_err("Failed to register video device");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment