Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: mediatek: vcodec: Fix v4l2 compliance decoder cmd test fail

Will return -EINVAL using standard framework api when test stateless
decoder with cmd VIDIOC_(TRY)DECODER_CMD. Disable them to adjust v4l2
compliance test for user driver(GStreamer/Chrome) won't use decoder cmd.

Fixes: 8cdc3794b2e3 ("media: mtk-vcodec: vdec: support stateless API")
Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Yunfei Dong and committed by
Mauro Carvalho Chehab
08a83828 f9222f8c

+4 -12
+1 -12
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
··· 47 47 static int vidioc_try_decoder_cmd(struct file *file, void *priv, 48 48 struct v4l2_decoder_cmd *cmd) 49 49 { 50 - struct mtk_vcodec_ctx *ctx = fh_to_ctx(priv); 51 - 52 - /* Use M2M stateless helper if relevant */ 53 - if (ctx->dev->vdec_pdata->uses_stateless_api) 54 - return v4l2_m2m_ioctl_stateless_try_decoder_cmd(file, priv, 55 - cmd); 56 - else 57 - return v4l2_m2m_ioctl_try_decoder_cmd(file, priv, cmd); 50 + return v4l2_m2m_ioctl_try_decoder_cmd(file, priv, cmd); 58 51 } 59 52 60 53 ··· 61 68 ret = vidioc_try_decoder_cmd(file, priv, cmd); 62 69 if (ret) 63 70 return ret; 64 - 65 - /* Use M2M stateless helper if relevant */ 66 - if (ctx->dev->vdec_pdata->uses_stateless_api) 67 - return v4l2_m2m_ioctl_stateless_decoder_cmd(file, priv, cmd); 68 71 69 72 mtk_v4l2_debug(1, "decoder cmd=%u", cmd->cmd); 70 73 dst_vq = v4l2_m2m_get_vq(ctx->m2m_ctx,
+3
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c
··· 400 400 } 401 401 402 402 if (dev->vdec_pdata->uses_stateless_api) { 403 + v4l2_disable_ioctl(vfd_dec, VIDIOC_DECODER_CMD); 404 + v4l2_disable_ioctl(vfd_dec, VIDIOC_TRY_DECODER_CMD); 405 + 403 406 dev->mdev_dec.dev = &pdev->dev; 404 407 strscpy(dev->mdev_dec.model, MTK_VCODEC_DEC_NAME, 405 408 sizeof(dev->mdev_dec.model));