aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-12-13 11:13:43 -0500
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-01-07 04:13:18 -0500
commitc108e660f9196a4cebea79fbd650ed6850934fcc (patch)
tree91fcda44ecc636262e06282bc0cfac1d8ac565c1
parent02f142ecd24aaf891324ffba8527284c1731b561 (diff)
[media] vb2: don't set index, don't start streaming for write()
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>
-rw-r--r--drivers/media/v4l2-core/videobuf2-core.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index 0d5b84f3b570..2552c4626826 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -2445,7 +2445,6 @@ static size_t __vb2_perform_fileio(struct vb2_queue *q, char __user *data, size_
2445 memset(&fileio->b, 0, sizeof(fileio->b)); 2445 memset(&fileio->b, 0, sizeof(fileio->b));
2446 fileio->b.type = q->type; 2446 fileio->b.type = q->type;
2447 fileio->b.memory = q->memory; 2447 fileio->b.memory = q->memory;
2448 fileio->b.index = index;
2449 ret = vb2_internal_dqbuf(q, &fileio->b, nonblock); 2448 ret = vb2_internal_dqbuf(q, &fileio->b, nonblock);
2450 dprintk(5, "file io: vb2_dqbuf result: %d\n", ret); 2449 dprintk(5, "file io: vb2_dqbuf result: %d\n", ret);
2451 if (ret) 2450 if (ret)
@@ -2527,15 +2526,6 @@ static size_t __vb2_perform_fileio(struct vb2_queue *q, char __user *data, size_
2527 * Switch to the next buffer 2526 * Switch to the next buffer
2528 */ 2527 */
2529 fileio->index = (index + 1) % q->num_buffers; 2528 fileio->index = (index + 1) % q->num_buffers;
2530
2531 /*
2532 * Start streaming if required.
2533 */
2534 if (!read && !q->streaming) {
2535 ret = vb2_internal_streamon(q, q->type);
2536 if (ret)
2537 return ret;
2538 }
2539 } 2529 }
2540 2530
2541 /* 2531 /*