[media] v4l2-core: deprecate V4L2_BUF_TYPE_PRIVATE
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 17 Sep 2012 08:02:26 +0000 (05:02 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 26 Sep 2012 12:38:15 +0000 (09:38 -0300)
This buffer type isn't used at all, and since it is effectively undefined
what it should do it is deprecated. The define still exists, but any
internal support for such buffers is removed.
The decisions to deprecate this was taken during the 2012 Media Workshop.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/v4l2-core/v4l2-compat-ioctl32.c
drivers/media/v4l2-core/v4l2-dev.c
drivers/media/v4l2-core/v4l2-ioctl.c
include/linux/videodev2.h
include/media/v4l2-ioctl.h

index e8437051d3ef0cb339952c0da2fc8893228d789a..83ffb6436baf67e22f7308acae67966dbfef6094 100644 (file)
@@ -195,10 +195,6 @@ static int __get_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __us
        case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
        case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
                return get_v4l2_sliced_vbi_format(&kp->fmt.sliced, &up->fmt.sliced);
-       case V4L2_BUF_TYPE_PRIVATE:
-               if (copy_from_user(kp, up, sizeof(kp->fmt.raw_data)))
-                       return -EFAULT;
-               return 0;
        default:
                printk(KERN_INFO "compat_ioctl32: unexpected VIDIOC_FMT type %d\n",
                                                                kp->type);
@@ -241,10 +237,6 @@ static int __put_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __us
        case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
        case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
                return put_v4l2_sliced_vbi_format(&kp->fmt.sliced, &up->fmt.sliced);
-       case V4L2_BUF_TYPE_PRIVATE:
-               if (copy_to_user(up, kp, sizeof(up->fmt.raw_data)))
-                       return -EFAULT;
-               return 0;
        default:
                printk(KERN_INFO "compat_ioctl32: unexpected VIDIOC_FMT type %d\n",
                                                                kp->type);
index 71237f5f85f4f6b5bc232618c1aeb9d03736c95d..95f92ea4dbd56aeac9233182bf5a6fa1ad1728b8 100644 (file)
@@ -565,8 +565,7 @@ static void determine_valid_ioctls(struct video_device *vdev)
            ops->vidioc_enum_fmt_vid_out ||
            ops->vidioc_enum_fmt_vid_cap_mplane ||
            ops->vidioc_enum_fmt_vid_out_mplane ||
-           ops->vidioc_enum_fmt_vid_overlay ||
-           ops->vidioc_enum_fmt_type_private)
+           ops->vidioc_enum_fmt_vid_overlay)
                set_bit(_IOC_NR(VIDIOC_ENUM_FMT), valid_ioctls);
        if (ops->vidioc_g_fmt_vid_cap ||
            ops->vidioc_g_fmt_vid_out ||
@@ -577,8 +576,7 @@ static void determine_valid_ioctls(struct video_device *vdev)
            ops->vidioc_g_fmt_vid_out_overlay ||
            ops->vidioc_g_fmt_vbi_out ||
            ops->vidioc_g_fmt_sliced_vbi_cap ||
-           ops->vidioc_g_fmt_sliced_vbi_out ||
-           ops->vidioc_g_fmt_type_private)
+           ops->vidioc_g_fmt_sliced_vbi_out)
                set_bit(_IOC_NR(VIDIOC_G_FMT), valid_ioctls);
        if (ops->vidioc_s_fmt_vid_cap ||
            ops->vidioc_s_fmt_vid_out ||
@@ -589,8 +587,7 @@ static void determine_valid_ioctls(struct video_device *vdev)
            ops->vidioc_s_fmt_vid_out_overlay ||
            ops->vidioc_s_fmt_vbi_out ||
            ops->vidioc_s_fmt_sliced_vbi_cap ||
-           ops->vidioc_s_fmt_sliced_vbi_out ||
-           ops->vidioc_s_fmt_type_private)
+           ops->vidioc_s_fmt_sliced_vbi_out)
                set_bit(_IOC_NR(VIDIOC_S_FMT), valid_ioctls);
        if (ops->vidioc_try_fmt_vid_cap ||
            ops->vidioc_try_fmt_vid_out ||
@@ -601,8 +598,7 @@ static void determine_valid_ioctls(struct video_device *vdev)
            ops->vidioc_try_fmt_vid_out_overlay ||
            ops->vidioc_try_fmt_vbi_out ||
            ops->vidioc_try_fmt_sliced_vbi_cap ||
-           ops->vidioc_try_fmt_sliced_vbi_out ||
-           ops->vidioc_try_fmt_type_private)
+           ops->vidioc_try_fmt_sliced_vbi_out)
                set_bit(_IOC_NR(VIDIOC_TRY_FMT), valid_ioctls);
        SET_VALID_IOCTL(ops, VIDIOC_REQBUFS, vidioc_reqbufs);
        SET_VALID_IOCTL(ops, VIDIOC_QUERYBUF, vidioc_querybuf);
index 932d9bf5990ab32daa35dbcbde4a4ff667455fa3..2f26e9496a3b8bca358025dc4874d957ff01db50 100644 (file)
@@ -316,9 +316,6 @@ static void v4l_print_format(const void *arg, bool write_only)
                                sliced->service_lines[0][i],
                                sliced->service_lines[1][i]);
                break;
-       case V4L2_BUF_TYPE_PRIVATE:
-               pr_cont("\n");
-               break;
        }
 }
 
@@ -927,9 +924,7 @@ static int check_fmt(const struct v4l2_ioctl_ops *ops, enum v4l2_buf_type type)
                if (ops->vidioc_g_fmt_sliced_vbi_out)
                        return 0;
                break;
-       case V4L2_BUF_TYPE_PRIVATE:
-               if (ops->vidioc_g_fmt_type_private)
-                       return 0;
+       default:
                break;
        }
        return -EINVAL;
@@ -1051,10 +1046,6 @@ static int v4l_enum_fmt(const struct v4l2_ioctl_ops *ops,
                if (unlikely(!ops->vidioc_enum_fmt_vid_out_mplane))
                        break;
                return ops->vidioc_enum_fmt_vid_out_mplane(file, fh, arg);
-       case V4L2_BUF_TYPE_PRIVATE:
-               if (unlikely(!ops->vidioc_enum_fmt_type_private))
-                       break;
-               return ops->vidioc_enum_fmt_type_private(file, fh, arg);
        }
        return -EINVAL;
 }
@@ -1105,10 +1096,6 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
                if (unlikely(!ops->vidioc_g_fmt_sliced_vbi_out))
                        break;
                return ops->vidioc_g_fmt_sliced_vbi_out(file, fh, arg);
-       case V4L2_BUF_TYPE_PRIVATE:
-               if (unlikely(!ops->vidioc_g_fmt_type_private))
-                       break;
-               return ops->vidioc_g_fmt_type_private(file, fh, arg);
        }
        return -EINVAL;
 }
@@ -1169,10 +1156,6 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops,
                        break;
                CLEAR_AFTER_FIELD(p, fmt.sliced);
                return ops->vidioc_s_fmt_sliced_vbi_out(file, fh, arg);
-       case V4L2_BUF_TYPE_PRIVATE:
-               if (unlikely(!ops->vidioc_s_fmt_type_private))
-                       break;
-               return ops->vidioc_s_fmt_type_private(file, fh, arg);
        }
        return -EINVAL;
 }
@@ -1233,10 +1216,6 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops,
                        break;
                CLEAR_AFTER_FIELD(p, fmt.sliced);
                return ops->vidioc_try_fmt_sliced_vbi_out(file, fh, arg);
-       case V4L2_BUF_TYPE_PRIVATE:
-               if (unlikely(!ops->vidioc_try_fmt_type_private))
-                       break;
-               return ops->vidioc_try_fmt_type_private(file, fh, arg);
        }
        return -EINVAL;
 }
@@ -1425,8 +1404,7 @@ static int v4l_reqbufs(const struct v4l2_ioctl_ops *ops,
        if (ret)
                return ret;
 
-       if (p->type < V4L2_BUF_TYPE_PRIVATE)
-               CLEAR_AFTER_FIELD(p, memory);
+       CLEAR_AFTER_FIELD(p, memory);
 
        return ops->vidioc_reqbufs(file, fh, p);
 }
index 1b72a38b7c8c8789e002df4228872afa3d9a409e..1ed8f904567dfefa96ef7d9970d4dcabb56eefb7 100644 (file)
@@ -162,6 +162,7 @@ enum v4l2_buf_type {
 #endif
        V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
        V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE  = 10,
+       /* Deprecated, do not use */
        V4L2_BUF_TYPE_PRIVATE              = 0x80,
 };
 
index e614c9c15e56ce0b396a8b03d47c81e08e197691..0bc1444e50ee924a6a80ab031e0bbbcacc84d2aa 100644 (file)
@@ -40,8 +40,6 @@ struct v4l2_ioctl_ops {
                                              struct v4l2_fmtdesc *f);
        int (*vidioc_enum_fmt_vid_out_mplane)(struct file *file, void *fh,
                                              struct v4l2_fmtdesc *f);
-       int (*vidioc_enum_fmt_type_private)(struct file *file, void *fh,
-                                           struct v4l2_fmtdesc *f);
 
        /* VIDIOC_G_FMT handlers */
        int (*vidioc_g_fmt_vid_cap)    (struct file *file, void *fh,
@@ -64,8 +62,6 @@ struct v4l2_ioctl_ops {
                                           struct v4l2_format *f);
        int (*vidioc_g_fmt_vid_out_mplane)(struct file *file, void *fh,
                                           struct v4l2_format *f);
-       int (*vidioc_g_fmt_type_private)(struct file *file, void *fh,
-                                       struct v4l2_format *f);
 
        /* VIDIOC_S_FMT handlers */
        int (*vidioc_s_fmt_vid_cap)    (struct file *file, void *fh,
@@ -88,8 +84,6 @@ struct v4l2_ioctl_ops {
                                           struct v4l2_format *f);
        int (*vidioc_s_fmt_vid_out_mplane)(struct file *file, void *fh,
                                           struct v4l2_format *f);
-       int (*vidioc_s_fmt_type_private)(struct file *file, void *fh,
-                                       struct v4l2_format *f);
 
        /* VIDIOC_TRY_FMT handlers */
        int (*vidioc_try_fmt_vid_cap)    (struct file *file, void *fh,
@@ -112,8 +106,6 @@ struct v4l2_ioctl_ops {
                                             struct v4l2_format *f);
        int (*vidioc_try_fmt_vid_out_mplane)(struct file *file, void *fh,
                                             struct v4l2_format *f);
-       int (*vidioc_try_fmt_type_private)(struct file *file, void *fh,
-                                         struct v4l2_format *f);
 
        /* Buffer handlers */
        int (*vidioc_reqbufs) (struct file *file, void *fh, struct v4l2_requestbuffers *b);