]> git.baikalelectronics.ru Git - kernel.git/commitdiff
media: mediatek: vcodec: Fix v4l2-compliance fail
authorYunfei Dong <yunfei.dong@mediatek.com>
Thu, 12 May 2022 02:19:44 +0000 (04:19 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 13 May 2022 12:46:39 +0000 (14:46 +0200)
Need to use default pic info when get pic info fail.

Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
Reviewed-by: Steve Cho <stevecho@chromium.org>
Tested-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c

index fae0dfc606b1074b9032517e1a746fb8776b9a46..ff79687089e230a36014c6dc3f88e6153b7fc3fc 100644 (file)
@@ -474,11 +474,14 @@ static int vidioc_vdec_s_fmt(struct file *file, void *priv,
                ctx->picinfo.pic_w = pix_mp->width;
                ctx->picinfo.pic_h = pix_mp->height;
 
+               /*
+                * If get pic info fail, need to use the default pic info params, or
+                * v4l2-compliance will fail
+                */
                ret = vdec_if_get_param(ctx, GET_PARAM_PIC_INFO, &ctx->picinfo);
                if (ret) {
                        mtk_v4l2_err("[%d]Error!! Get GET_PARAM_PICTURE_INFO Fail",
                                     ctx->id);
-                       return -EINVAL;
                }
 
                ctx->last_decoded_picinfo = ctx->picinfo;