Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242068
b: refs/heads/master
c: 29e3fbd
h: refs/heads/master
v: v3
  • Loading branch information
Marek Szyprowski authored and Mauro Carvalho Chehab committed Mar 22, 2011
1 parent 3dfab4c commit bdb6c60
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bd08a0cd5f546916a9454ae2c35756ed77957458
refs/heads/master: 29e3fbd8edb31549fa8302c185bd0b915a43d8b8
9 changes: 8 additions & 1 deletion trunk/drivers/media/video/videobuf2-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req)
return -EINVAL;
}

if (req->count == 0 || q->num_buffers != 0) {
if (req->count == 0 || q->num_buffers != 0 || q->memory != req->memory) {
/*
* We already have buffers allocated, so first check if they
* are not in use and can be freed.
Expand All @@ -501,6 +501,13 @@ int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req)
ret = __vb2_queue_free(q);
if (ret != 0)
return ret;

/*
* In case of REQBUFS(0) return immediately without calling
* driver's queue_setup() callback and allocating resources.
*/
if (req->count == 0)
return 0;
}

/*
Expand Down

0 comments on commit bdb6c60

Please sign in to comment.