linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Irui Wang (王瑞)" <Irui.Wang@mediatek.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org" 
	<linux-mediatek@lists.infradead.org>,
	"dafna.hirschfeld@collabora.com" <dafna.hirschfeld@collabora.com>
Cc: "dafna3@gmail.com" <dafna3@gmail.com>,
	"tfiga@chromium.org" <tfiga@chromium.org>,
	"Tiffany Lin (林慧珊)" <tiffany.lin@mediatek.com>,
	"eizan@chromium.org" <eizan@chromium.org>,
	"Maoguang Meng (孟毛广)" <Maoguang.Meng@mediatek.com>,
	"kernel@collabora.com" <kernel@collabora.com>,
	"mchehab@kernel.org" <mchehab@kernel.org>,
	"hverkuil@xs4all.nl" <hverkuil@xs4all.nl>,
	"Yunfei Dong (董云飞)" <Yunfei.Dong@mediatek.com>,
	"Yong Wu (吴勇)" <Yong.Wu@mediatek.com>,
	"hsinyi@chromium.org" <hsinyi@chromium.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"Andrew-CT Chen (陳智迪)" <Andrew-CT.Chen@mediatek.com>,
	"acourbot@chromium.org" <acourbot@chromium.org>
Subject: Re: [PATCH 4/5] media: mtk-vcodec: Add two error cases upon vpu irq handling
Date: Fri, 6 Aug 2021 06:58:45 +0000	[thread overview]
Message-ID: <81524c608e9ef640e71d969aa83d1a383e687b0a.camel@mediatek.com> (raw)
In-Reply-To: <20210804142729.7231-5-dafna.hirschfeld@collabora.com>

On Wed, 2021-08-04 at 16:27 +0200, Dafna Hirschfeld wrote:
> 1. Fail if the function mtk_vcodec_fw_map_dm_addr
> returns ERR pointer.
> 2. Fail if the state from the vpu msg is either
> VEN_IPI_MSG_ENC_STATE_ERROR or VEN_IPI_MSG_ENC_STATE_PART
> 
> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
> ---
>  drivers/media/platform/mtk-vcodec/venc_vpu_if.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/media/platform/mtk-vcodec/venc_vpu_if.c
> b/drivers/media/platform/mtk-vcodec/venc_vpu_if.c
> index 32dc844d16f9..234705ba7cd6 100644
> --- a/drivers/media/platform/mtk-vcodec/venc_vpu_if.c
> +++ b/drivers/media/platform/mtk-vcodec/venc_vpu_if.c
> @@ -17,6 +17,8 @@ static int handle_enc_init_msg(struct venc_vpu_inst
> *vpu, const void *data)
>  	vpu->vsi = mtk_vcodec_fw_map_dm_addr(vpu->ctx->dev->fw_handler,
>  					     msg->vpu_inst_addr);
>  
> +	if (IS_ERR(vpu->vsi))
> +		return PTR_ERR(vpu->vsi);
>  	/* Firmware version field value is unspecified on MT8173. */
>  	if (vpu->ctx->dev->venc_pdata->chip == MTK_MT8173)
>  		return 0;
> @@ -42,6 +44,12 @@ static int handle_enc_encode_msg(struct
> venc_vpu_inst *vpu, const void *data)
>  	vpu->state = msg->state;
>  	vpu->bs_size = msg->bs_size;
>  	vpu->is_key_frm = msg->is_key_frm;
> +	if (vpu->state == VEN_IPI_MSG_ENC_STATE_ERROR ||
> +	    vpu->state == VEN_IPI_MSG_ENC_STATE_PART) {
> +		mtk_vcodec_err(vpu, "bad ipi-enc-state: %s",
> +			       vpu->state ==
> VEN_IPI_MSG_ENC_STATE_ERROR ? "ERR" : "PART");
> +		return -EINVAL;
> +	}

Hi Dafna,

This state check is useless, the enc result will check in
"vpu_enc_ipi_handler".

Thanks

>  	return 0;
>  }
>  

  reply	other threads:[~2021-08-06  6:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04 14:27 [PATCH 0/5] media: mtk-vcodec: venc: variouse bug fixes Dafna Hirschfeld
2021-08-04 14:27 ` [PATCH 1/5] media: mtk-vcodec: enter ABORT state if encoding failed Dafna Hirschfeld
2021-08-04 14:27 ` [PATCH 2/5] media: mtk-vcodec: call v4l2_m2m_ctx_release first when file is released Dafna Hirschfeld
2021-08-04 14:27 ` [PATCH 3/5] media: mtk-vcodec: change the venc handler funcs to return int Dafna Hirschfeld
2021-08-04 14:27 ` [PATCH 4/5] media: mtk-vcodec: Add two error cases upon vpu irq handling Dafna Hirschfeld
2021-08-06  6:58   ` Irui Wang (王瑞) [this message]
2021-08-06  7:48     ` Dafna Hirschfeld
2021-08-04 14:27 ` [PATCH 5/5] media: mtk-vcodec: venc: Fail if a msg sent to VPU was not signaled Dafna Hirschfeld
2021-08-06  6:50   ` Irui Wang (王瑞)
2021-10-18 11:43     ` Dafna Hirschfeld

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=81524c608e9ef640e71d969aa83d1a383e687b0a.camel@mediatek.com \
    --to=irui.wang@mediatek.com \
    --cc=Andrew-CT.Chen@mediatek.com \
    --cc=Maoguang.Meng@mediatek.com \
    --cc=Yong.Wu@mediatek.com \
    --cc=Yunfei.Dong@mediatek.com \
    --cc=acourbot@chromium.org \
    --cc=dafna.hirschfeld@collabora.com \
    --cc=dafna3@gmail.com \
    --cc=eizan@chromium.org \
    --cc=hsinyi@chromium.org \
    --cc=hverkuil@xs4all.nl \
    --cc=kernel@collabora.com \
    --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=tfiga@chromium.org \
    --cc=tiffany.lin@mediatek.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).