Re: [PATCH v6 01/14] media: mediatek: vcodec: support vcp architecture

From: Kyrie Wu (吴晗)

Date: Sun Aug 09 2026 - 23:06:22 EST


On Mon, 2026-07-20 at 08:57 -0400, Nicolas Dufresne wrote:
> Hi,
>
> Le lundi 20 juillet 2026 à 09:20 +0800, Kyrie Wu a écrit :
> > Some platforms expose the video codec through the VCP coprocessor.
> > Use the VCP architecture when the VCP coprocessor is found.
> >
> > Signed-off-by: Kyrie Wu <kyrie.wu@xxxxxxxxxxxx>
> > Reviewed-by: Nicolas Dufresne <nicolas.dufresne@xxxxxxxxxxxxx>
> > ---
> >  drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw.h  | 1
> > +
> >  .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c      | 3
> > +++
> >  2 files changed, 4 insertions(+)
> >
> > diff --git
> > a/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw.h
> > b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw.h
> > index 300363a40..c1642fb09 100644
> > --- a/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw.h
> > +++ b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw.h
> > @@ -14,6 +14,7 @@ struct mtk_vcodec_enc_dev;
> >  enum mtk_vcodec_fw_type {
> >   VPU,
> >   SCP,
> > + VCP,
> >  };
> >  
> >  enum mtk_vcodec_fw_use {
> > diff --git
> > a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv
> > .c
> > b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv
> > .c
> > index e936ed8df..d220b645e 100644
> > ---
> > a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv
> > .c
> > +++
> > b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv
> > .c
> > @@ -379,6 +379,9 @@ static int mtk_vcodec_probe(struct
> > platform_device *pdev)
> >   } else if (!of_property_read_u32(pdev->dev.of_node,
> > "mediatek,scp",
> >   &rproc_phandle)) {
> >   fw_type = SCP;
> > + } else if (!of_property_read_u32(pdev->dev.of_node,
> > "mediatek,vcp",
> > + &rproc_phandle)) {
> > + fw_type = VCP;
>
> I know I gave an rb a while ago, but then we reviewed the 8189 code,
> and we
> underlined that this makes little sense, and that fw_type should
> simply be set
> in the pdata. Same applies to mtk_vcodec_dec_get_chip_name(), the
> chip "name",
> or integer form of, is clearly a 1 to 1 match for pdata.
>
> Nicolas

Hi Nicolas,

Thanks for the review.

I agree. Since the platform data is introduced in the MT8189 patch
series, I will move fw_type to the platform data and make
mtk_vcodec_dec_get_chip_name() derive the chip identifier from it in
the MT8189 series.

Best regards,
Kyrie
>
> >   } else {
> >   dev_dbg(&pdev->dev, "Could not get vdec IPI
> > device");
> >   return -ENODEV;