static int vb2_internal_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking) { int ret; if (b->type != q->type) { dprintk(1, "invalid buffer type\n"); return -EINVAL; } ret = vb2_core_dqbuf(q, NULL, b, nonblocking); return ret; }
static int vb2_internal_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking) { int ret; if (b->type != q->type) { dprintk(1, "invalid buffer type\n"); return -EINVAL; } ret = vb2_core_dqbuf(q, b, nonblocking); if (!ret && !q->is_output && b->flags & V4L2_BUF_FLAG_LAST) q->last_buffer_dequeued = true; return ret; }
int dvb_vb2_dqbuf(struct dvb_vb2_ctx *ctx, struct dmx_buffer *b) { unsigned long flags; int ret; ret = vb2_core_dqbuf(&ctx->vb_q, &b->index, b, ctx->nonblocking); if (ret) { dprintk(1, "[%s] errno=%d\n", ctx->name, ret); return ret; } spin_lock_irqsave(&ctx->slock, flags); b->count = ctx->count++; b->flags = ctx->flags; ctx->flags = 0; spin_unlock_irqrestore(&ctx->slock, flags); dprintk(5, "[%s] index=%d, count=%d, flags=%d\n", ctx->name, b->index, ctx->count, b->flags); return 0; }
int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking) { int ret; if (vb2_fileio_is_active(q)) { dprintk(1, "file io in progress\n"); return -EBUSY; } if (b->type != q->type) { dprintk(1, "invalid buffer type\n"); return -EINVAL; } ret = vb2_core_dqbuf(q, NULL, b, nonblocking); /* * After calling the VIDIOC_DQBUF V4L2_BUF_FLAG_DONE must be * cleared. */ b->flags &= ~V4L2_BUF_FLAG_DONE; return ret; }