[PATCH 3/5] media: mediatek: vcodec: Fix h264 set lat buffer error

AngeloGioacchino Del Regno angelogioacchino.delregno at collabora.com
Mon Nov 14 03:26:41 PST 2022


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 at mediatek.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




More information about the Linux-mediatek mailing list