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

Configure Feed

Select the types of activity you want to include in your feed.

media: verisilicon: Explicitly disable selection api ioctls for decoders

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>

authored by

Paul Kocialkowski and committed by
Hans Verkuil
73d50aa9 3d4a87ad

+4 -4
+2
drivers/media/platform/verisilicon/hantro_drv.c
··· 916 916 vpu->decoder = func; 917 917 v4l2_disable_ioctl(vfd, VIDIOC_TRY_ENCODER_CMD); 918 918 v4l2_disable_ioctl(vfd, VIDIOC_ENCODER_CMD); 919 + v4l2_disable_ioctl(vfd, VIDIOC_G_SELECTION); 920 + v4l2_disable_ioctl(vfd, VIDIOC_S_SELECTION); 919 921 } 920 922 921 923 video_set_drvdata(vfd, vpu);
+2 -4
drivers/media/platform/verisilicon/hantro_v4l2.c
··· 663 663 struct hantro_ctx *ctx = file_to_ctx(file); 664 664 665 665 /* Crop only supported on source. */ 666 - if (!ctx->is_encoder || 667 - sel->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) 666 + if (sel->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) 668 667 return -EINVAL; 669 668 670 669 switch (sel->target) { ··· 695 696 struct vb2_queue *vq; 696 697 697 698 /* Crop only supported on source. */ 698 - if (!ctx->is_encoder || 699 - sel->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) 699 + if (sel->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) 700 700 return -EINVAL; 701 701 702 702 /* Change not allowed if the queue is streaming. */