Lines Matching defs:q_ctx

126 	struct v4l2_m2m_queue_ctx *q_ctx;
128 q_ctx = get_queue_ctx(m2m_ctx, type);
129 if (!q_ctx)
132 return &q_ctx->q;
136 struct vb2_v4l2_buffer *v4l2_m2m_next_buf(struct v4l2_m2m_queue_ctx *q_ctx)
141 spin_lock_irqsave(&q_ctx->rdy_spinlock, flags);
143 if (list_empty(&q_ctx->rdy_queue)) {
144 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
148 b = list_first_entry(&q_ctx->rdy_queue, struct v4l2_m2m_buffer, list);
149 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
154 struct vb2_v4l2_buffer *v4l2_m2m_last_buf(struct v4l2_m2m_queue_ctx *q_ctx)
159 spin_lock_irqsave(&q_ctx->rdy_spinlock, flags);
161 if (list_empty(&q_ctx->rdy_queue)) {
162 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
166 b = list_last_entry(&q_ctx->rdy_queue, struct v4l2_m2m_buffer, list);
167 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
172 struct vb2_v4l2_buffer *v4l2_m2m_buf_remove(struct v4l2_m2m_queue_ctx *q_ctx)
177 spin_lock_irqsave(&q_ctx->rdy_spinlock, flags);
178 if (list_empty(&q_ctx->rdy_queue)) {
179 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
182 b = list_first_entry(&q_ctx->rdy_queue, struct v4l2_m2m_buffer, list);
184 q_ctx->num_rdy--;
185 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
191 void v4l2_m2m_buf_remove_by_buf(struct v4l2_m2m_queue_ctx *q_ctx,
197 spin_lock_irqsave(&q_ctx->rdy_spinlock, flags);
200 q_ctx->num_rdy--;
201 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
206 v4l2_m2m_buf_remove_by_idx(struct v4l2_m2m_queue_ctx *q_ctx, unsigned int idx)
213 spin_lock_irqsave(&q_ctx->rdy_spinlock, flags);
214 list_for_each_entry_safe(b, tmp, &q_ctx->rdy_queue, list) {
217 q_ctx->num_rdy--;
222 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
876 struct v4l2_m2m_queue_ctx *q_ctx;
883 q_ctx = get_queue_ctx(m2m_ctx, type);
884 ret = vb2_streamoff(&q_ctx->q, type);
895 spin_lock_irqsave(&q_ctx->rdy_spinlock, flags);
898 INIT_LIST_HEAD(&q_ctx->rdy_queue);
899 q_ctx->num_rdy = 0;
900 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);
1288 struct v4l2_m2m_queue_ctx *q_ctx;
1291 q_ctx = get_queue_ctx(m2m_ctx, vbuf->vb2_buf.vb2_queue->type);
1292 if (!q_ctx)
1295 spin_lock_irqsave(&q_ctx->rdy_spinlock, flags);
1296 list_add_tail(&b->list, &q_ctx->rdy_queue);
1297 q_ctx->num_rdy++;
1298 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags);