summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMing Qian <ming.qian@nxp.com>2022-05-09 09:52:25 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-05-13 11:02:22 +0200
commitd67005b7dc8235870fca149e1fb149340eeaa698 (patch)
tree0c64cd7ed684f0f897630ae96d7af0c1a98d4f90 /drivers/media
parent81cad440dd1bc00277ce17f12fc6ca326d2731f6 (diff)
downloadlinux-d67005b7dc8235870fca149e1fb149340eeaa698.tar.bz2
media: amphion: G/S_PARM only for encoder's output queue
G/S_PARM doesn't make sense for the capture queue of a stateful encoder, unless V4L2_FMT_FLAG_ENC_CAP_FRAME_INTERVAL is set to reserve hardware resources. Otherwise it will fail the v4l2-compliance Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/amphion/venc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/platform/amphion/venc.c b/drivers/media/platform/amphion/venc.c
index ba9f49cca155..43d61d82f58c 100644
--- a/drivers/media/platform/amphion/venc.c
+++ b/drivers/media/platform/amphion/venc.c
@@ -283,6 +283,9 @@ static int venc_g_parm(struct file *file, void *fh, struct v4l2_streamparm *parm
if (!parm)
return -EINVAL;
+ if (!V4L2_TYPE_IS_OUTPUT(parm->type))
+ return -EINVAL;
+
if (!vpu_helper_check_type(inst, parm->type))
return -EINVAL;
@@ -304,6 +307,9 @@ static int venc_s_parm(struct file *file, void *fh, struct v4l2_streamparm *parm
if (!parm)
return -EINVAL;
+ if (!V4L2_TYPE_IS_OUTPUT(parm->type))
+ return -EINVAL;
+
if (!vpu_helper_check_type(inst, parm->type))
return -EINVAL;