[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <11a5fbb6-f462-bdc5-1592-32e8f2664a48@collabora.com>
Date: Mon, 14 Nov 2022 12:26:41 +0100
From: AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
To: Yunfei Dong <yunfei.dong@...iatek.com>,
Chen-Yu Tsai <wenst@...omium.org>,
Nicolas Dufresne <nicolas@...fresne.ca>,
Hans Verkuil <hverkuil-cisco@...all.nl>,
Benjamin Gaignard <benjamin.gaignard@...labora.com>,
Tiffany Lin <tiffany.lin@...iatek.com>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
George Sun <george.sun@...iatek.com>,
Xiaoyong Lu <xiaoyong.lu@...iatek.com>,
Hsin-Yi Wang <hsinyi@...omium.org>,
Fritz Koenig <frkoenig@...omium.org>,
Daniel Vetter <daniel@...ll.ch>,
Steve Cho <stevecho@...omium.org>, linux-media@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
Project_Global_Chrome_Upstream_Group@...iatek.com
Subject: Re: [PATCH 3/5] media: mediatek: vcodec: Fix h264 set lat buffer
error
Il 12/11/22 10:41, Yunfei Dong ha scritto:
> Will set lat buffer to lat_list two times when lat decode timeout for
> inner racing mode.
>
> If core thread can't get frame buffer, need to return error value.
>
> Fixes: 59fba9eed5a7 ("media: mediatek: vcodec: support stateless H.264 decoding for mt8192")
> Signed-off-by: Yunfei Dong <yunfei.dong@...iatek.com>
> ---
> .../vcodec/vdec/vdec_h264_req_multi_if.c | 23 ++++++++++++-------
> 1 file changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_multi_if.c b/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_multi_if.c
> index 4cc92700692b..2b7576265f48 100644
> --- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_multi_if.c
> +++ b/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_multi_if.c
> @@ -471,6 +471,12 @@ static int vdec_h264_slice_core_decode(struct vdec_lat_buf *lat_buf)
> sizeof(share_info->h264_slice_params));
>
> fb = ctx->dev->vdec_pdata->get_cap_buffer(ctx);
> + if (!fb) {
> + err = -EBUSY;
> + mtk_vcodec_err(inst, "fb buffer is NULL");
> + goto vdec_dec_end;
> + }
> +
> y_fb_dma = fb ? (u64)fb->base_y.dma_addr : 0;
If you're jumping to vdec_dec_end, this check becomes pointless as y_fb_dma
will never be set to 0, so you can remove the conditional on assigning
the dma address to `y_fb_dma`.
Same comment a few lines later for `c_fb_dma`.
Regards,
Angelo
Powered by blists - more mailing lists