lkml.org 
[lkml]   [2021]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v7, 12/15] media: mtk-vcodec: Support 34bits dma address for vdec
From
Date
Hi AngeloGioacchino,

Thanks for your suggestion.
On Thu, 2021-10-14 at 13:02 +0200, AngeloGioacchino Del Regno wrote:
> > Use the dma_set_mask_and_coherent helper to set vdec
> > 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 VDEC actually locate, it
> > depends on the dma-ranges property of vdec dtsi node.
> >
> > Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
> > ---
> > drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
> > b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
> > index de83e3b821b4..da963cdac96b 100644
> > --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
> > +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
> > @@ -376,6 +376,9 @@ static int mtk_vcodec_probe(struct
> > platform_device *pdev)
> > }
> > }
> >
> > + if (of_get_property(pdev->dev.of_node, "dma-ranges", NULL))
> > + dma_set_mask_and_coherent(&pdev->dev,
> > DMA_BIT_MASK(34));
> > +
>
Will fix in patch v8.
> This function returns 0 for success, or negative number for failure:
> please check
> the return value, or this driver may not work correctly in some
> corner cases.
>
> Regards,
> - Angelo
>
> > for (i = 0; i < MTK_VDEC_HW_MAX; i++)
> > mutex_init(&dev->dec_mutex[i]);
> > spin_lock_init(&dev->irqlock);
> >
\
 
 \ /
  Last update: 2021-10-27 05:45    [W:1.221 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site