Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271763
b: refs/heads/master
c: a6bd62b
h: refs/heads/master
i:
  271761: 4797ee1
  271759: 8300c56
v: v3
  • Loading branch information
Andrzej Pietrasiewicz authored and Mauro Carvalho Chehab committed Sep 6, 2011
1 parent feeb3db commit 971bedc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 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: 1d0c86cad38678fa42f6d048a7b9e4057c8c16fc
refs/heads/master: a6bd62be5a3e3a2eee9c0c1d7c04cb52cff3e073
18 changes: 10 additions & 8 deletions trunk/drivers/media/video/v4l2-mem2mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,12 @@ void *v4l2_m2m_next_buf(struct v4l2_m2m_queue_ctx *q_ctx)

spin_lock_irqsave(&q_ctx->rdy_spinlock, flags);

if (list_empty(&q_ctx->rdy_queue))
goto end;
if (list_empty(&q_ctx->rdy_queue)) {
spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
return NULL;
}

b = list_entry(q_ctx->rdy_queue.next, struct v4l2_m2m_buffer, list);
end:
spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
return &b->vb;
}
Expand All @@ -117,12 +118,13 @@ void *v4l2_m2m_buf_remove(struct v4l2_m2m_queue_ctx *q_ctx)
unsigned long flags;

spin_lock_irqsave(&q_ctx->rdy_spinlock, flags);
if (!list_empty(&q_ctx->rdy_queue)) {
b = list_entry(q_ctx->rdy_queue.next, struct v4l2_m2m_buffer,
list);
list_del(&b->list);
q_ctx->num_rdy--;
if (list_empty(&q_ctx->rdy_queue)) {
spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
return NULL;
}
b = list_entry(q_ctx->rdy_queue.next, struct v4l2_m2m_buffer, list);
list_del(&b->list);
q_ctx->num_rdy--;
spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);

return &b->vb;
Expand Down

0 comments on commit 971bedc

Please sign in to comment.