Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 366559
b: refs/heads/master
c: 401f6a2
h: refs/heads/master
i:
  366557: 3d1c9b0
  366555: 74bd6ce
  366551: 1a3c7fa
  366543: 79d15dd
  366527: a6de7cc
v: v3
  • Loading branch information
John Sheu authored and Mauro Carvalho Chehab committed Mar 19, 2013
1 parent 141ac1c commit 2af5890
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 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: f1a0569be680a1bfb9d624cc4893cba0c6ad4172
refs/heads/master: 401f6a2729988c7229c3a78bba0d2f73851e3f51
31 changes: 28 additions & 3 deletions trunk/drivers/media/v4l2-core/v4l2-mem2mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,35 @@ EXPORT_SYMBOL_GPL(v4l2_m2m_streamon);
int v4l2_m2m_streamoff(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
enum v4l2_buf_type type)
{
struct vb2_queue *vq;
struct v4l2_m2m_dev *m2m_dev;
struct v4l2_m2m_queue_ctx *q_ctx;
unsigned long flags_job, flags;
int ret;

vq = v4l2_m2m_get_vq(m2m_ctx, type);
return vb2_streamoff(vq, type);
q_ctx = get_queue_ctx(m2m_ctx, type);
ret = vb2_streamoff(&q_ctx->q, type);
if (ret)
return ret;

m2m_dev = m2m_ctx->m2m_dev;
spin_lock_irqsave(&m2m_dev->job_spinlock, flags_job);
/* We should not be scheduled anymore, since we're dropping a queue. */
INIT_LIST_HEAD(&m2m_ctx->queue);
m2m_ctx->job_flags = 0;

spin_lock_irqsave(&q_ctx->rdy_spinlock, flags);
/* Drop queue, since streamoff returns device to the same state as after
* calling reqbufs. */
INIT_LIST_HEAD(&q_ctx->rdy_queue);
spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);

if (m2m_dev->curr_ctx == m2m_ctx) {
m2m_dev->curr_ctx = NULL;
wake_up(&m2m_ctx->finished);
}
spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags_job);

return 0;
}
EXPORT_SYMBOL_GPL(v4l2_m2m_streamoff);

Expand Down

0 comments on commit 2af5890

Please sign in to comment.