summaryrefslogtreecommitdiff
path: root/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2023-03-02 15:57:28 +0300
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-03-20 02:32:00 +0300
commit99ba0703c6f4c79674039746e923d0fc84543cea (patch)
treee8cd353b570bfb700889d7e0db6b052f9bfe033d /drivers/media/v4l2-core/v4l2-compat-ioctl32.c
parent2e19bfc8ab175ce1a5251d2b580b19add8a8f1fd (diff)
downloadlinux-99ba0703c6f4c79674039746e923d0fc84543cea.tar.xz
media: v4l2-core: drop v4l2_window clipping and bitmap support
There are no longer any drivers that support clipping and bitmap support for the capture or output overlay interfaces, so drop this. Always set the bitmap, clips and clipcount fields to 0, and remove the compat32 support. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-compat-ioctl32.c')
-rw-r--r--drivers/media/v4l2-core/v4l2-compat-ioctl32.c78
1 files changed, 10 insertions, 68 deletions
diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
index 55c26e7d370e..e7baa2880eeb 100644
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
@@ -38,18 +38,13 @@
* data to the routine.
*/
-struct v4l2_clip32 {
- struct v4l2_rect c;
- compat_caddr_t next;
-};
-
struct v4l2_window32 {
struct v4l2_rect w;
__u32 field; /* enum v4l2_field */
__u32 chromakey;
- compat_caddr_t clips; /* actually struct v4l2_clip32 * */
- __u32 clipcount;
- compat_caddr_t bitmap;
+ compat_caddr_t clips; /* always NULL */
+ __u32 clipcount; /* always 0 */
+ compat_caddr_t bitmap; /* always NULL */
__u8 global_alpha;
};
@@ -65,17 +60,12 @@ static int get_v4l2_window32(struct v4l2_window *p64,
.w = w32.w,
.field = w32.field,
.chromakey = w32.chromakey,
- .clips = (void __force *)compat_ptr(w32.clips),
- .clipcount = w32.clipcount,
- .bitmap = compat_ptr(w32.bitmap),
+ .clips = NULL,
+ .clipcount = 0,
+ .bitmap = NULL,
.global_alpha = w32.global_alpha,
};
- if (p64->clipcount > 2048)
- return -EINVAL;
- if (!p64->clipcount)
- p64->clips = NULL;
-
return 0;
}
@@ -89,16 +79,13 @@ static int put_v4l2_window32(struct v4l2_window *p64,
.w = p64->w,
.field = p64->field,
.chromakey = p64->chromakey,
- .clips = (uintptr_t)p64->clips,
- .clipcount = p64->clipcount,
- .bitmap = ptr_to_compat(p64->bitmap),
+ .clips = 0,
+ .clipcount = 0,
+ .bitmap = 0,
.global_alpha = p64->global_alpha,
};
- /* copy everything except the clips pointer */
- if (copy_to_user(p32, &w32, offsetof(struct v4l2_window32, clips)) ||
- copy_to_user(&p32->clipcount, &w32.clipcount,
- sizeof(w32) - offsetof(struct v4l2_window32, clipcount)))
+ if (copy_to_user(p32, &w32, sizeof(w32)))
return -EFAULT;
return 0;
@@ -1043,29 +1030,6 @@ int v4l2_compat_get_array_args(struct file *file, void *mbuf,
memset(mbuf, 0, array_size);
switch (cmd) {
- case VIDIOC_G_FMT32:
- case VIDIOC_S_FMT32:
- case VIDIOC_TRY_FMT32: {
- struct v4l2_format *f64 = arg;
- struct v4l2_clip *c64 = mbuf;
- struct v4l2_clip32 __user *c32 = user_ptr;
- u32 clipcount = f64->fmt.win.clipcount;
-
- if ((f64->type != V4L2_BUF_TYPE_VIDEO_OVERLAY &&
- f64->type != V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY) ||
- clipcount == 0)
- return 0;
- if (clipcount > 2048)
- return -EINVAL;
- while (clipcount--) {
- if (copy_from_user(c64, c32, sizeof(c64->c)))
- return -EFAULT;
- c64->next = NULL;
- c64++;
- c32++;
- }
- break;
- }
#ifdef CONFIG_COMPAT_32BIT_TIME
case VIDIOC_QUERYBUF32_TIME32:
case VIDIOC_QBUF32_TIME32:
@@ -1136,28 +1100,6 @@ int v4l2_compat_put_array_args(struct file *file, void __user *user_ptr,
int err = 0;
switch (cmd) {
- case VIDIOC_G_FMT32:
- case VIDIOC_S_FMT32:
- case VIDIOC_TRY_FMT32: {
- struct v4l2_format *f64 = arg;
- struct v4l2_clip *c64 = mbuf;
- struct v4l2_clip32 __user *c32 = user_ptr;
- u32 clipcount = f64->fmt.win.clipcount;
-
- if ((f64->type != V4L2_BUF_TYPE_VIDEO_OVERLAY &&
- f64->type != V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY) ||
- clipcount == 0)
- return 0;
- if (clipcount > 2048)
- return -EINVAL;
- while (clipcount--) {
- if (copy_to_user(c32, c64, sizeof(c64->c)))
- return -EFAULT;
- c64++;
- c32++;
- }
- break;
- }
#ifdef CONFIG_COMPAT_32BIT_TIME
case VIDIOC_QUERYBUF32_TIME32:
case VIDIOC_QBUF32_TIME32: