]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] vb2: don't set index, don't start streaming for write()
authorHans Verkuil <hans.verkuil@cisco.com>
Fri, 13 Dec 2013 16:13:43 +0000 (13:13 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 7 Jan 2014 09:13:18 +0000 (07:13 -0200)
Two fixes:

- there is no need to set the index when calling dqbuf: dqbuf will
  overwrite it.
- __vb2_init_fileio already starts streaming for write(), so there is
  no need to do it again in __vb2_perform_fileio. It can never have
  worked anyway: either __vb2_init_fileio succeeds in starting streaming
  or it is never going to happen.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/v4l2-core/videobuf2-core.c

index 0d5b84f3b570fe3f7d2c047dfe27f4faf4024db5..2552c4626826c350305f3a5e166204355a1f6829 100644 (file)
@@ -2445,7 +2445,6 @@ static size_t __vb2_perform_fileio(struct vb2_queue *q, char __user *data, size_
                memset(&fileio->b, 0, sizeof(fileio->b));
                fileio->b.type = q->type;
                fileio->b.memory = q->memory;
-               fileio->b.index = index;
                ret = vb2_internal_dqbuf(q, &fileio->b, nonblock);
                dprintk(5, "file io: vb2_dqbuf result: %d\n", ret);
                if (ret)
@@ -2527,15 +2526,6 @@ static size_t __vb2_perform_fileio(struct vb2_queue *q, char __user *data, size_
                 * Switch to the next buffer
                 */
                fileio->index = (index + 1) % q->num_buffers;
-
-               /*
-                * Start streaming if required.
-                */
-               if (!read && !q->streaming) {
-                       ret = vb2_internal_streamon(q, q->type);
-                       if (ret)
-                               return ret;
-               }
        }
 
        /*