• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/media/video/

Lines Matching refs:m2m_ctx

65 static struct v4l2_m2m_queue_ctx *get_queue_ctx(struct v4l2_m2m_ctx *m2m_ctx,
70 return &m2m_ctx->cap_q_ctx;
72 return &m2m_ctx->out_q_ctx;
82 struct videobuf_queue *v4l2_m2m_get_vq(struct v4l2_m2m_ctx *m2m_ctx,
87 q_ctx = get_queue_ctx(m2m_ctx, type);
98 void *v4l2_m2m_next_buf(struct v4l2_m2m_ctx *m2m_ctx, enum v4l2_buf_type type)
104 q_ctx = get_queue_ctx(m2m_ctx, type);
126 void *v4l2_m2m_buf_remove(struct v4l2_m2m_ctx *m2m_ctx, enum v4l2_buf_type type)
132 q_ctx = get_queue_ctx(m2m_ctx, type);
204 * @m2m_ctx: m2m context assigned to the instance to be checked
217 static void v4l2_m2m_try_schedule(struct v4l2_m2m_ctx *m2m_ctx)
222 m2m_dev = m2m_ctx->m2m_dev;
223 dprintk("Trying to schedule a job for m2m_ctx: %p\n", m2m_ctx);
225 if (!m2m_ctx->out_q_ctx.q.streaming
226 || !m2m_ctx->cap_q_ctx.q.streaming) {
232 if (m2m_ctx->job_flags & TRANS_QUEUED) {
238 spin_lock_irqsave(m2m_ctx->out_q_ctx.q.irqlock, flags);
239 if (list_empty(&m2m_ctx->out_q_ctx.rdy_queue)) {
240 spin_unlock_irqrestore(m2m_ctx->out_q_ctx.q.irqlock, flags);
245 if (list_empty(&m2m_ctx->cap_q_ctx.rdy_queue)) {
246 spin_unlock_irqrestore(m2m_ctx->out_q_ctx.q.irqlock, flags);
251 spin_unlock_irqrestore(m2m_ctx->out_q_ctx.q.irqlock, flags);
254 && (!m2m_dev->m2m_ops->job_ready(m2m_ctx->priv))) {
260 list_add_tail(&m2m_ctx->queue, &m2m_dev->job_queue);
261 m2m_ctx->job_flags |= TRANS_QUEUED;
281 struct v4l2_m2m_ctx *m2m_ctx)
286 if (!m2m_dev->curr_ctx || m2m_dev->curr_ctx != m2m_ctx) {
301 v4l2_m2m_try_schedule(m2m_ctx);
309 int v4l2_m2m_reqbufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
314 vq = v4l2_m2m_get_vq(m2m_ctx, reqbufs->type);
324 int v4l2_m2m_querybuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
330 vq = v4l2_m2m_get_vq(m2m_ctx, buf->type);
346 int v4l2_m2m_qbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
352 vq = v4l2_m2m_get_vq(m2m_ctx, buf->type);
355 v4l2_m2m_try_schedule(m2m_ctx);
365 int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
370 vq = v4l2_m2m_get_vq(m2m_ctx, buf->type);
378 int v4l2_m2m_streamon(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
384 vq = v4l2_m2m_get_vq(m2m_ctx, type);
387 v4l2_m2m_try_schedule(m2m_ctx);
396 int v4l2_m2m_streamoff(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
401 vq = v4l2_m2m_get_vq(m2m_ctx, type);
414 unsigned int v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
421 src_q = v4l2_m2m_get_src_vq(m2m_ctx);
422 dst_q = v4l2_m2m_get_dst_vq(m2m_ctx);
469 int v4l2_m2m_mmap(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
476 vq = v4l2_m2m_get_src_vq(m2m_ctx);
478 vq = v4l2_m2m_get_dst_vq(m2m_ctx);
538 struct v4l2_m2m_ctx *m2m_ctx;
544 m2m_ctx = kzalloc(sizeof *m2m_ctx, GFP_KERNEL);
545 if (!m2m_ctx)
548 m2m_ctx->priv = priv;
549 m2m_ctx->m2m_dev = m2m_dev;
551 out_q_ctx = get_queue_ctx(m2m_ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
552 cap_q_ctx = get_queue_ctx(m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE);
557 INIT_LIST_HEAD(&m2m_ctx->queue);
563 return m2m_ctx;
572 void v4l2_m2m_ctx_release(struct v4l2_m2m_ctx *m2m_ctx)
578 m2m_dev = m2m_ctx->m2m_dev;
581 if (m2m_ctx->job_flags & TRANS_RUNNING) {
583 m2m_dev->m2m_ops->job_abort(m2m_ctx->priv);
584 dprintk("m2m_ctx %p running, will wait to complete", m2m_ctx);
585 vb = v4l2_m2m_next_dst_buf(m2m_ctx);
589 } else if (m2m_ctx->job_flags & TRANS_QUEUED) {
590 list_del(&m2m_ctx->queue);
591 m2m_ctx->job_flags &= ~(TRANS_QUEUED | TRANS_RUNNING);
593 dprintk("m2m_ctx: %p had been on queue and was removed\n",
594 m2m_ctx);
600 videobuf_stop(&m2m_ctx->cap_q_ctx.q);
601 videobuf_stop(&m2m_ctx->out_q_ctx.q);
603 videobuf_mmap_free(&m2m_ctx->cap_q_ctx.q);
604 videobuf_mmap_free(&m2m_ctx->out_q_ctx.q);
606 kfree(m2m_ctx);
618 void v4l2_m2m_buf_queue(struct v4l2_m2m_ctx *m2m_ctx, struct videobuf_queue *vq,
623 q_ctx = get_queue_ctx(m2m_ctx, vq->type);