/* Query buffer */ static int vidioc_querybuf(struct file *file, void *priv, struct v4l2_buffer *buf) { struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); int ret; int i; if (buf->memory != V4L2_MEMORY_MMAP) { mfc_err("Only mmaped buffers can be used\n"); return -EINVAL; } mfc_debug(2, "State: %d, buf->type: %d\n", ctx->state, buf->type); if (ctx->state == MFCINST_INIT && buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { ret = vb2_querybuf(&ctx->vq_src, buf); } else if (ctx->state == MFCINST_RUNNING && buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { ret = vb2_querybuf(&ctx->vq_dst, buf); for (i = 0; i < buf->length; i++) buf->m.planes[i].m.mem_offset += DST_QUEUE_OFF_BASE; } else { mfc_err("vidioc_querybuf called in an inappropriate state\n"); ret = -EINVAL; } mfc_debug_leave(); return ret; }
static int nxp_video_querybuf(struct file *file, void *fh, struct v4l2_buffer *b) { struct nxp_video *me = file->private_data; if (me->vbq) { return vb2_querybuf(me->vbq, b); } else { struct vb2_queue *vq = v4l2_m2m_get_vq(me->m2m_ctx, b->type); return vb2_querybuf(vq, b); } }
static int fimc_lite_querybuf(struct file *file, void *priv, struct v4l2_buffer *buf) { struct fimc_lite *fimc = video_drvdata(file); return vb2_querybuf(&fimc->vb_queue, buf); }
int vb2_ioctl_querybuf(struct file *file, void *priv, struct v4l2_buffer *p) { struct video_device *vdev = video_devdata(file); /* No need to call vb2_queue_is_busy(), anyone can query buffers. */ return vb2_querybuf(vdev->queue, p); }
static int fimc_cap_querybuf(struct file *file, void *priv, struct v4l2_buffer *buf) { struct fimc_dev *fimc = video_drvdata(file); return vb2_querybuf(&fimc->vid_cap.vbq, buf); }
static int iss_video_querybuf(struct file *file, void *fh, struct v4l2_buffer *b) { struct iss_video_fh *vfh = to_iss_video_fh(fh); return vb2_querybuf(&vfh->queue, b); }
static int mxr_querybuf(struct file *file, void *priv, struct v4l2_buffer *p) { struct mxr_layer *layer = video_drvdata(file); mxr_dbg(layer->mdev, "%s:%d\n", __func__, __LINE__); return vb2_querybuf(&layer->vb_queue, p); }
static int gsc_capture_querybuf(struct file *file, void *priv, struct v4l2_buffer *buf) { struct gsc_dev *gsc = video_drvdata(file); struct gsc_capture_device *cap = &gsc->cap; return vb2_querybuf(&cap->vbq, buf); }
static int fimc_cap_querybuf(struct file *file, void *priv, struct v4l2_buffer *buf) { struct fimc_ctx *ctx = priv; struct fimc_vid_cap *cap = &ctx->fimc_dev->vid_cap; return vb2_querybuf(&cap->vbq, buf); }
static int at91sam9x5_video_vidioc_querybuf(struct file *filp, void *fh, struct v4l2_buffer *b) { struct video_device *vdev = filp->private_data; struct at91sam9x5_video_priv *priv = video_get_drvdata(vdev); return vb2_querybuf(&priv->queue, b); }
static int fimc_is_isp_video_querybuf(struct file *file, void *priv, struct v4l2_buffer *buf) { struct fimc_is_video_dev *video = file->private_data; printk(KERN_DEBUG "%s\n", __func__); return vb2_querybuf(&video->vbq, buf); }
int uvcg_query_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf) { int ret; mutex_lock(&queue->mutex); ret = vb2_querybuf(&queue->queue, buf); mutex_unlock(&queue->mutex); return ret; }
static int hwcam_dev_vo_querybuf( struct file* filep, void* fh, struct v4l2_buffer* pb) { hwcam_dev_t* cam = video_drvdata(filep); hwcam_user_t* user = VO2USER(fh); BUG_ON(!cam || !user); return vb2_querybuf(&user->vb2q, pb); }
static int fimc_is_scc_video_querybuf(struct file *file, void *priv, struct v4l2_buffer *buf) { int ret; struct fimc_is_video_ctx *video_ctx = file->private_data; dbg("%s\n", __func__); ret = vb2_querybuf(&video_ctx->vbq, buf); return ret; }
static int fimc_is_bayer_video_querybuf(struct file *file, void *priv, struct v4l2_buffer *buf) { int ret; struct fimc_is_video_sensor *video = file->private_data; dbg_sensor("%s\n", __func__); ret = vb2_querybuf(&video->common.vbq, buf); return ret; }
static int vidioc_querybuf(struct file *file, void *priv, struct v4l2_buffer *p) { struct vcap_client_data *c_data = file->private_data; switch (p->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: return vb2_querybuf(&c_data->vc_vidq, p); default: pr_err("VCAP Error: %s: Unknown buffer type\n", __func__); return -EINVAL; } return 0; }
int fimc_is_video_querybuf(struct file *file, struct fimc_is_video_ctx *vctx, struct v4l2_buffer *buf) { int ret = 0; struct fimc_is_queue *queue; queue = GET_QUEUE(vctx); ret = vb2_querybuf(queue->vbq, buf); return ret; }
static int xvip_dma_querybuf(struct file *file, void *fh, struct v4l2_buffer *buf) { struct v4l2_fh *vfh = file->private_data; struct xvip_dma *dma = to_xvip_dma(vfh->vdev); int ret; mutex_lock(&dma->lock); ret = vb2_querybuf(&dma->queue, buf); mutex_unlock(&dma->lock); return ret; }
/** * v4l2_m2m_querybuf() - multi-queue-aware QUERYBUF multiplexer * * See v4l2_m2m_mmap() documentation for details. */ int v4l2_m2m_querybuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, struct v4l2_buffer *buf) { struct vb2_queue *vq; int ret = 0; unsigned int i; vq = v4l2_m2m_get_vq(m2m_ctx, buf->type); ret = vb2_querybuf(vq, buf); /* Adjust MMAP memory offsets for the CAPTURE queue */ if (buf->memory == V4L2_MEMORY_MMAP && !V4L2_TYPE_IS_OUTPUT(vq->type)) { if (V4L2_TYPE_IS_MULTIPLANAR(vq->type)) { for (i = 0; i < buf->length; ++i) buf->m.planes[i].m.mem_offset += DST_QUEUE_OFF_BASE; } else { buf->m.offset += DST_QUEUE_OFF_BASE; } } return ret; }
/* 查询buffer信息 */ static int myvivi_vidioc_querybuf(struct file *file, void *priv, struct v4l2_buffer *p) { return vb2_querybuf(&myvivi_vb_vidqueue, p); }
int uvcg_query_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf) { return vb2_querybuf(&queue->queue, buf); }