Message ID | 1652948174-7123-3-git-send-email-kyrie.wu@mediatek.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Enable hardware jpeg encoder for MT8186 | expand |
On Thu, 2022-05-19 at 16:16 +0800, kyrie.wu wrote: > From: kyrie wu <kyrie.wu@mediatek.com> > > set bit mask for jpeg encode > > Signed-off-by: kyrie wu <kyrie.wu@mediatek.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"); Hello Kyrie, if you want to add this property in dts, you need to add a new property description to descript this. BRs, Rex
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");