Lines Matching refs:q_ctx

122 	struct v4l2_m2m_queue_ctx *q_ctx;  in v4l2_m2m_get_vq()  local
124 q_ctx = get_queue_ctx(m2m_ctx, type); in v4l2_m2m_get_vq()
125 if (!q_ctx) in v4l2_m2m_get_vq()
128 return &q_ctx->q; in v4l2_m2m_get_vq()
132 void *v4l2_m2m_next_buf(struct v4l2_m2m_queue_ctx *q_ctx) in v4l2_m2m_next_buf() argument
137 spin_lock_irqsave(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_next_buf()
139 if (list_empty(&q_ctx->rdy_queue)) { in v4l2_m2m_next_buf()
140 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_next_buf()
144 b = list_first_entry(&q_ctx->rdy_queue, struct v4l2_m2m_buffer, list); in v4l2_m2m_next_buf()
145 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_next_buf()
150 void *v4l2_m2m_last_buf(struct v4l2_m2m_queue_ctx *q_ctx) in v4l2_m2m_last_buf() argument
155 spin_lock_irqsave(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_last_buf()
157 if (list_empty(&q_ctx->rdy_queue)) { in v4l2_m2m_last_buf()
158 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_last_buf()
162 b = list_last_entry(&q_ctx->rdy_queue, struct v4l2_m2m_buffer, list); in v4l2_m2m_last_buf()
163 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_last_buf()
168 void *v4l2_m2m_buf_remove(struct v4l2_m2m_queue_ctx *q_ctx) in v4l2_m2m_buf_remove() argument
173 spin_lock_irqsave(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_buf_remove()
174 if (list_empty(&q_ctx->rdy_queue)) { in v4l2_m2m_buf_remove()
175 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_buf_remove()
178 b = list_first_entry(&q_ctx->rdy_queue, struct v4l2_m2m_buffer, list); in v4l2_m2m_buf_remove()
180 q_ctx->num_rdy--; in v4l2_m2m_buf_remove()
181 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_buf_remove()
187 void v4l2_m2m_buf_remove_by_buf(struct v4l2_m2m_queue_ctx *q_ctx, in v4l2_m2m_buf_remove_by_buf() argument
193 spin_lock_irqsave(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_buf_remove_by_buf()
196 q_ctx->num_rdy--; in v4l2_m2m_buf_remove_by_buf()
197 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_buf_remove_by_buf()
202 v4l2_m2m_buf_remove_by_idx(struct v4l2_m2m_queue_ctx *q_ctx, unsigned int idx) in v4l2_m2m_buf_remove_by_idx() argument
209 spin_lock_irqsave(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_buf_remove_by_idx()
210 list_for_each_entry_safe(b, tmp, &q_ctx->rdy_queue, list) { in v4l2_m2m_buf_remove_by_idx()
213 q_ctx->num_rdy--; in v4l2_m2m_buf_remove_by_idx()
218 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_buf_remove_by_idx()
580 struct v4l2_m2m_queue_ctx *q_ctx; in v4l2_m2m_streamoff() local
587 q_ctx = get_queue_ctx(m2m_ctx, type); in v4l2_m2m_streamoff()
588 ret = vb2_streamoff(&q_ctx->q, type); in v4l2_m2m_streamoff()
599 spin_lock_irqsave(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_streamoff()
602 INIT_LIST_HEAD(&q_ctx->rdy_queue); in v4l2_m2m_streamoff()
603 q_ctx->num_rdy = 0; in v4l2_m2m_streamoff()
604 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_streamoff()
967 struct v4l2_m2m_queue_ctx *q_ctx; in v4l2_m2m_buf_queue() local
970 q_ctx = get_queue_ctx(m2m_ctx, vbuf->vb2_buf.vb2_queue->type); in v4l2_m2m_buf_queue()
971 if (!q_ctx) in v4l2_m2m_buf_queue()
974 spin_lock_irqsave(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_buf_queue()
975 list_add_tail(&b->list, &q_ctx->rdy_queue); in v4l2_m2m_buf_queue()
976 q_ctx->num_rdy++; in v4l2_m2m_buf_queue()
977 spin_unlock_irqrestore(&q_ctx->rdy_spinlock, flags); in v4l2_m2m_buf_queue()