mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-04-08 12:02:33 +02:00
media: verisilicon: Explicitly disable selection api ioctls for decoders
[ Upstream commit 73d50aa92f ]
Call the dedicated v4l2_disable_ioctl helper instead of manually
checking whether the current context is an encoder for the selection
api ioctls.
Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f6405d5ea2
commit
f013e6aadd
@@ -918,6 +918,8 @@ static int hantro_add_func(struct hantro_dev *vpu, unsigned int funcid)
|
||||
vpu->decoder = func;
|
||||
v4l2_disable_ioctl(vfd, VIDIOC_TRY_ENCODER_CMD);
|
||||
v4l2_disable_ioctl(vfd, VIDIOC_ENCODER_CMD);
|
||||
v4l2_disable_ioctl(vfd, VIDIOC_G_SELECTION);
|
||||
v4l2_disable_ioctl(vfd, VIDIOC_S_SELECTION);
|
||||
}
|
||||
|
||||
video_set_drvdata(vfd, vpu);
|
||||
|
||||
@@ -633,8 +633,7 @@ static int vidioc_g_selection(struct file *file, void *priv,
|
||||
struct hantro_ctx *ctx = fh_to_ctx(priv);
|
||||
|
||||
/* Crop only supported on source. */
|
||||
if (!ctx->is_encoder ||
|
||||
sel->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
|
||||
if (sel->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
|
||||
return -EINVAL;
|
||||
|
||||
switch (sel->target) {
|
||||
@@ -666,8 +665,7 @@ static int vidioc_s_selection(struct file *file, void *priv,
|
||||
struct vb2_queue *vq;
|
||||
|
||||
/* Crop only supported on source. */
|
||||
if (!ctx->is_encoder ||
|
||||
sel->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
|
||||
if (sel->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
|
||||
return -EINVAL;
|
||||
|
||||
/* Change not allowed if the queue is streaming. */
|
||||
|
||||
Reference in New Issue
Block a user