static int fimc_lite_create_bufs(struct file *file, void *priv, struct v4l2_create_buffers *create) { struct fimc_lite *fimc = video_drvdata(file); return vb2_create_bufs(&fimc->vb_queue, create); }
static int fimc_cap_create_bufs(struct file *file, void *priv, struct v4l2_create_buffers *create) { struct fimc_dev *fimc = video_drvdata(file); return vb2_create_bufs(&fimc->vid_cap.vbq, create); }
/** * v4l2_m2m_create_bufs() - create a source or destination buffer, depending * on the type */ int v4l2_m2m_create_bufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, struct v4l2_create_buffers *create) { struct vb2_queue *vq; vq = v4l2_m2m_get_vq(m2m_ctx, create->format.type); return vb2_create_bufs(vq, create); }
int uvc_create_buffers(struct uvc_video_queue *queue, struct v4l2_create_buffers *cb) { int ret; mutex_lock(&queue->mutex); ret = vb2_create_bufs(&queue->queue, cb); mutex_unlock(&queue->mutex); return ret; }
int vb2_ioctl_create_bufs(struct file *file, void *priv, struct v4l2_create_buffers *p) { struct video_device *vdev = video_devdata(file); int res = vb2_verify_memory_type(vdev->queue, p->memory, p->format.type); p->index = vdev->queue->num_buffers; /* * If count == 0, then just check if memory and type are valid. * Any -EBUSY result from vb2_verify_memory_type can be mapped to 0. */ if (p->count == 0) return res != -EBUSY ? res : 0; if (res) return res; if (vb2_queue_is_busy(vdev, file)) return -EBUSY; res = vb2_create_bufs(vdev->queue, p); if (res == 0) vdev->queue->owner = file->private_data; return res; }