Revert "[media] vb2: add allow_zero_bytesused flag to the vb2_queue struct"
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 2 Jul 2015 08:55:59 +0000 (10:55 +0200)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 31 Mar 2016 07:59:14 +0000 (16:59 +0900)
This reverts commit f61bf13b6a07a93b9348e77808d369803f40b681.

drivers/media/v4l2-core/videobuf2-core.c
include/media/videobuf2-core.h

index 66ada01c796ca934527321fe67406667c2927c9a..5101208f8b071d37981e2395d5f62d994392857b 100644 (file)
@@ -1247,16 +1247,6 @@ static void __fill_vb2_buffer(struct vb2_buffer *vb, const struct v4l2_buffer *b
 {
        unsigned int plane;
 
-       if (V4L2_TYPE_IS_OUTPUT(b->type)) {
-               if (WARN_ON_ONCE(b->bytesused == 0)) {
-                       pr_warn_once("use of bytesused == 0 is deprecated and will be removed in the future,\n");
-                       if (vb->vb2_queue->allow_zero_bytesused)
-                               pr_warn_once("use VIDIOC_DECODER_CMD(V4L2_DEC_CMD_STOP) instead.\n");
-                       else
-                               pr_warn_once("use the actual size instead.\n");
-               }
-       }
-
        if (V4L2_TYPE_IS_MULTIPLANAR(b->type)) {
                if (b->memory == V4L2_MEMORY_USERPTR) {
                        for (plane = 0; plane < vb->num_planes; ++plane) {
@@ -1286,22 +1276,13 @@ static void __fill_vb2_buffer(struct vb2_buffer *vb, const struct v4l2_buffer *b
                         * userspace clearly never bothered to set it and
                         * it's a safe assumption that they really meant to
                         * use the full plane sizes.
-                        *
-                        * Some drivers, e.g. old codec drivers, use bytesused == 0
-                        * as a way to indicate that streaming is finished.
-                        * In that case, the driver should use the
-                        * allow_zero_bytesused flag to keep old userspace
-                        * applications working.
                         */
                        for (plane = 0; plane < vb->num_planes; ++plane) {
                                struct v4l2_plane *pdst = &v4l2_planes[plane];
                                struct v4l2_plane *psrc = &b->m.planes[plane];
 
-                               if (vb->vb2_queue->allow_zero_bytesused)
-                                       pdst->bytesused = psrc->bytesused;
-                               else
-                                       pdst->bytesused = psrc->bytesused ?
-                                               psrc->bytesused : pdst->length;
+                               pdst->bytesused = psrc->bytesused ?
+                                       psrc->bytesused : pdst->length;
                                pdst->data_offset = psrc->data_offset;
                        }
                }
@@ -1314,11 +1295,6 @@ static void __fill_vb2_buffer(struct vb2_buffer *vb, const struct v4l2_buffer *b
                 *
                 * If bytesused == 0 for the output buffer, then fall back
                 * to the full buffer size as that's a sensible default.
-                *
-                * Some drivers, e.g. old codec drivers, use bytesused == 0 as
-                * a way to indicate that streaming is finished. In that case,
-                * the driver should use the allow_zero_bytesused flag to keep
-                * old userspace applications working.
                 */
                if (b->memory == V4L2_MEMORY_USERPTR) {
                        v4l2_planes[0].m.userptr = b->m.userptr;
@@ -1330,13 +1306,10 @@ static void __fill_vb2_buffer(struct vb2_buffer *vb, const struct v4l2_buffer *b
                        v4l2_planes[0].length = b->length;
                }
 
-               if (V4L2_TYPE_IS_OUTPUT(b->type)) {
-                       if (vb->vb2_queue->allow_zero_bytesused)
-                               v4l2_planes[0].bytesused = b->bytesused;
-                       else
-                               v4l2_planes[0].bytesused = b->bytesused ?
-                                       b->bytesused : v4l2_planes[0].length;
-               } else
+               if (V4L2_TYPE_IS_OUTPUT(b->type))
+                       v4l2_planes[0].bytesused = b->bytesused ?
+                               b->bytesused : v4l2_planes[0].length;
+               else
                        v4l2_planes[0].bytesused = 0;
 
        }
index a5790fd5d12500aa3abac79a8271b1e0fb9ea2ba..e49dc6b0de81f10055222aef18c13ce998b69874 100644 (file)
@@ -337,7 +337,6 @@ struct v4l2_fh;
  * @io_modes:  supported io methods (see vb2_io_modes enum)
  * @fileio_read_once:          report EOF after reading the first buffer
  * @fileio_write_immediately:  queue buffer after each write() call
- * @allow_zero_bytesused:      allow bytesused == 0 to be passed to the driver
  * @lock:      pointer to a mutex that protects the vb2_queue struct. The
  *             driver can set this to a mutex to let the v4l2 core serialize
  *             the queuing ioctls. If the driver wants to handle locking
@@ -389,7 +388,6 @@ struct vb2_queue {
        unsigned int                    io_modes;
        unsigned                        fileio_read_once:1;
        unsigned                        fileio_write_immediately:1;
-       unsigned                        allow_zero_bytesused:1;
 
        struct mutex                    *lock;
        struct v4l2_fh                  *owner;