diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2011-03-11 04:07:27 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-22 03:54:28 -0400 |
commit | 31901a078af29c33c736dcbf815656920e904632 (patch) | |
tree | d39614aca1f27ad0aeec8152043198ade75e881f | |
parent | a9bb36aa0d6547aa0ab3d5cfde08e8651bd460bc (diff) |
[media] v4l2: vb2: one more fix for REQBUFS()
Return immediately if the target number of buffers is the same as
the current one and memory access type doesn't change.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/videobuf2-core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/video/videobuf2-core.c b/drivers/media/video/videobuf2-core.c index c5f99c7d3979..2baf7dbdc01d 100644 --- a/drivers/media/video/videobuf2-core.c +++ b/drivers/media/video/videobuf2-core.c | |||
@@ -488,6 +488,13 @@ int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req) | |||
488 | return -EINVAL; | 488 | return -EINVAL; |
489 | } | 489 | } |
490 | 490 | ||
491 | /* | ||
492 | * If the same number of buffers and memory access method is requested | ||
493 | * then return immediately. | ||
494 | */ | ||
495 | if (q->memory == req->memory && req->count == q->num_buffers) | ||
496 | return 0; | ||
497 | |||
491 | if (req->count == 0 || q->num_buffers != 0 || q->memory != req->memory) { | 498 | if (req->count == 0 || q->num_buffers != 0 || q->memory != req->memory) { |
492 | /* | 499 | /* |
493 | * We already have buffers allocated, so first check if they | 500 | * We already have buffers allocated, so first check if they |