Skip to content

Commit

Permalink
media: mediatek: vcodec: Remove the setting for dma_mask
Browse files Browse the repository at this point in the history
In order to simplify the masters to set their respective dma masks, MTK
IOMMU helps to centralize the processing. Because all the dma ranges is
set in IOMMU, IOMMU knows well the dma mask requirements of masters. After
this patch, the masters(codec here) code does not need care
dma-ranges/dma_mask related information.

Cc: Tiffany Lin <tiffany.lin@mediatek.com>
Cc: Andrew-CT Chen <andrew-ct.chen@mediatek.com>
Cc: Yunfei Dong <yunfei.dong@mediatek.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: irui wang <irui.wang@mediatek.com>
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230411093144.2690-12-yong.wu@mediatek.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Yong Wu authored and Joerg Roedel committed Apr 13, 2023
1 parent 7d35584 commit aa0ee7b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
8 changes: 0 additions & 8 deletions drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
}
}

if (of_get_property(pdev->dev.of_node, "dma-ranges", NULL)) {
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(34));
if (ret) {
mtk_v4l2_err("Failed to set mask");
goto err_core_workq;
}
}

for (i = 0; i < MTK_VDEC_HW_MAX; i++)
mutex_init(&dev->dec_mutex[i]);
mutex_init(&dev->dev_mutex);
Expand Down
3 changes: 0 additions & 3 deletions drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,6 @@ 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");
Expand Down

0 comments on commit aa0ee7b

Please sign in to comment.