Commit ca43692a authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

media: coda: disable encoder ioctls for decoder devices

Use v4l2_disable_ioctl() to disable the encoder ioctls
VIDIOC_ENUM_FRAMESIZES, VIDIOC_ENUM_FRAMEINTERVALS, VIDIOC_G_PARM, and
VIDIOC_S_PARM, to fix this v4l2-compliance test failure:

		fail: v4l2-test-formats.cpp(1363): node->is_m2m && !is_stateful_enc
	test VIDIOC_G/S_PARM: FAIL
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: default avatarNicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent e7326bec
...@@ -1269,9 +1269,6 @@ static int coda_enum_framesizes(struct file *file, void *fh, ...@@ -1269,9 +1269,6 @@ static int coda_enum_framesizes(struct file *file, void *fh,
struct coda_q_data *q_data_dst; struct coda_q_data *q_data_dst;
const struct coda_codec *codec; const struct coda_codec *codec;
if (ctx->inst_type != CODA_INST_ENCODER)
return -ENOTTY;
if (fsize->index) if (fsize->index)
return -EINVAL; return -EINVAL;
...@@ -2885,6 +2882,10 @@ static int coda_register_device(struct coda_dev *dev, int i) ...@@ -2885,6 +2882,10 @@ static int coda_register_device(struct coda_dev *dev, int i)
} else { } else {
v4l2_disable_ioctl(vfd, VIDIOC_ENCODER_CMD); v4l2_disable_ioctl(vfd, VIDIOC_ENCODER_CMD);
v4l2_disable_ioctl(vfd, VIDIOC_TRY_ENCODER_CMD); v4l2_disable_ioctl(vfd, VIDIOC_TRY_ENCODER_CMD);
v4l2_disable_ioctl(vfd, VIDIOC_ENUM_FRAMESIZES);
v4l2_disable_ioctl(vfd, VIDIOC_ENUM_FRAMEINTERVALS);
v4l2_disable_ioctl(vfd, VIDIOC_G_PARM);
v4l2_disable_ioctl(vfd, VIDIOC_S_PARM);
} }
ret = video_register_device(vfd, VFL_TYPE_VIDEO, 0); ret = video_register_device(vfd, VFL_TYPE_VIDEO, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment