From: "Irui Wang (王瑞)" <Irui.Wang@mediatek.com>
To: "matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"mchehab@kernel.org" <mchehab@kernel.org>,
"sebastian.fricke@collabora.com" <sebastian.fricke@collabora.com>,
"angelogioacchino.delregno@collabora.com"
<angelogioacchino.delregno@collabora.com>,
"nicolas.dufresne@collabora.com" <nicolas.dufresne@collabora.com>,
"hverkuil-cisco@xs4all.nl" <hverkuil-cisco@xs4all.nl>,
"Yunfei Dong (董云飞)" <Yunfei.Dong@mediatek.com>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
"Maoguang Meng (孟毛广)" <Maoguang.Meng@mediatek.com>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"Longfei Wang (王龙飞)" <Longfei.Wang@mediatek.com>,
Project_Global_Chrome_Upstream_Group
<Project_Global_Chrome_Upstream_Group@mediatek.com>
Subject: Re: [PATCH] media: mediatek: vcodec: Handle invalid decoder vsi
Date: Sat, 23 Mar 2024 01:45:14 +0000 [thread overview]
Message-ID: <ef36f69b2bed28c4c084d24948ba56690e6989b1.camel@mediatek.com> (raw)
In-Reply-To: <6420a5c39e0a6f85d4fd5a85643d601bd1e2fb05.camel@collabora.com>
Dear Nicolas,
Thanks for your reviewing.
On Fri, 2024-03-22 at 10:44 -0400, Nicolas Dufresne wrote:
> Hi,
>
> Le mercredi 20 mars 2024 à 14:13 +0800, Irui Wang a écrit :
> > Handle invalid decoder vsi in vpu_dec_init to ensure the decoder
> > vsi is
> > valid for future use.
> >
> > Signed-off-by: Irui Wang <irui.wang@mediatek.com>
> > ---
> > .../media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c | 6
> > ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git
> > a/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c
> > b/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c
> > index 82e57ae983d5..17770993fe5a 100644
> > --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c
> > +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c
> > @@ -231,6 +231,12 @@ int vpu_dec_init(struct vdec_vpu_inst *vpu)
> > mtk_vdec_debug(vpu->ctx, "vdec_inst=%p", vpu);
> >
> > err = vcodec_vpu_send_msg(vpu, (void *)&msg, sizeof(msg));
> > +
> > + if (IS_ERR_OR_NULL(vpu->vsi)) {
> > + mtk_vdec_err(vpu->ctx, "invalid vdec vsi, status=%d",
> > err);
> > + return -EINVAL;
> > + }
> > +
>
> Make sense, though on the cosmetic side, were is the err value from
> if the vsi
> pointer is NULL ?
Do you mean the returned 'err'?, it's the status value returned by
'send message'. Even if the 'vsi' is NULL, the returned status value
'err' may still be 'NO_ERROR', there is no direct relationship between
them.
If I misunderstood your question, please correct me. Thank you very
much.
>
> Nicolas
>
> > mtk_vdec_debug(vpu->ctx, "- ret=%d", err);
> > return err;
> > }
>
>
prev parent reply other threads:[~2024-03-23 1:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-20 6:13 [PATCH] media: mediatek: vcodec: Handle invalid decoder vsi Irui Wang
2024-03-20 9:13 ` AngeloGioacchino Del Regno
2024-03-21 1:55 ` Irui Wang (王瑞)
2024-03-22 14:44 ` Nicolas Dufresne
2024-03-23 1:45 ` Irui Wang (王瑞) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ef36f69b2bed28c4c084d24948ba56690e6989b1.camel@mediatek.com \
--to=irui.wang@mediatek.com \
--cc=Longfei.Wang@mediatek.com \
--cc=Maoguang.Meng@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=Yunfei.Dong@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=nicolas.dufresne@collabora.com \
--cc=sebastian.fricke@collabora.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).