[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+Px+wWRE0DR15GgorZnoN1xdAqoau94gkoF7-x7h2hd21ZGXg@mail.gmail.com>
Date: Fri, 9 Jul 2021 15:59:52 +0800
From: Tzung-Bi Shih <tzungbi@...gle.com>
To: Yunfei Dong <Yunfei.Dong@...iatek.com>
Cc: Alexandre Courbot <acourbot@...omium.org>,
Hans Verkuil <hverkuil-cisco@...all.nl>,
Tzung-Bi Shih <tzungbi@...omium.org>,
Tiffany Lin <tiffany.lin@...iatek.com>,
Andrew-CT Chen <andrew-ct.chen@...iatek.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Tomasz Figa <tfiga@...gle.com>,
Hsin-Yi Wang <hsinyi@...omium.org>,
Fritz Koenig <frkoenig@...omium.org>,
Irui Wang <irui.wang@...iatek.com>,
linux-media@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
srv_heupstream@...iatek.com, linux-mediatek@...ts.infradead.org,
Project_Global_Chrome_Upstream_Group@...iatek.com
Subject: Re: [PATCH v1, 06/14] media: mtk-vcodec: Add irq interface for core hardware
On Wed, Jul 7, 2021 at 2:22 PM Yunfei Dong <yunfei.dong@...iatek.com> wrote:
> +static int mtk_vcodec_get_hw_count(struct mtk_vcodec_dev *dev)
> +{
> + if (dev->vdec_pdata->hw_arch == MTK_VDEC_PURE_SINGLE_CORE)
> + return 1;
> + else if (dev->vdec_pdata->hw_arch == MTK_VDEC_LAT_SINGLE_CORE)
> + return 2;
> + else
> + return 0;
> +}
Use a switch .. case .. would be easier to read.
Would it be better to use some macro or enums for the magic numbers?
> @@ -113,8 +114,7 @@ static int mtk_vdec_comp_init_irq(struct mtk_vdec_comp_dev *dev)
> }
>
> ret = devm_request_irq(&pdev->dev, dev->dec_irq,
> - mtk_vdec_comp_irq_handler,
> - 0, pdev->name, dev);
> + mtk_vdec_comp_irq_handler, 0, pdev->name, dev);
The change is irrelevant to this patch.
> @@ -154,8 +154,10 @@ static int mtk_vdec_comp_probe(struct platform_device *pdev)
> dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(34));
>
> ret = mtk_vdec_comp_init_irq(dev);
> - if (ret)
> + if (ret) {
> + dev_err(&pdev->dev, "Failed to register irq handler.\n");
> goto err;
> + }
The change shouldn't be in this patch. Instead, another patch that
adds the mtk_vdec_comp_init_irq() invocation.
> +int mtk_vcodec_wait_for_comp_done_ctx(struct mtk_vcodec_ctx *ctx,
Remove the extra space before "*ctx".
Powered by blists - more mailing lists