int fimc_is_video_mmap(struct file *file,
	struct fimc_is_video_ctx *vctx,
	struct vm_area_struct *vma)
{
	u32 ret = 0;
	u32 video_type = vctx->type;

	switch (video_type) {
	case FIMC_IS_VIDEO_TYPE_OUTPUT:
		ret = vb2_mmap(vctx->q_src.vbq, vma);
		break;
	case FIMC_IS_VIDEO_TYPE_CAPTURE:
		ret = vb2_mmap(vctx->q_dst.vbq, vma);
		break;
	case FIMC_IS_VIDEO_TYPE_M2M:
		merr("video mmap is not supported", vctx);
		ret = -EINVAL;
		break;
	default:
		merr("invalid type(%d)", vctx, video_type);
		ret = -EINVAL;
		break;
	}

	return ret;
}
Beispiel #2
0
static int fimc_capture_mmap(struct file *file, struct vm_area_struct *vma)
{
    struct fimc_ctx *ctx = file->private_data;
    struct fimc_dev *fimc = ctx->fimc_dev;

    return vb2_mmap(&fimc->vid_cap.vbq, vma);
}
static int fimc_is_bayer_video_mmap(struct file *file,
					struct vm_area_struct *vma)
{
	struct fimc_is_core *is = video_drvdata(file);

	return vb2_mmap(&is->video_sensor.common.vbq, vma);
}
static int fimc_is_isp_mmap(struct file *file, struct vm_area_struct *vma)
{
	struct fimc_is_dev *is_dev;

	dbg("(FIMC-IS cap_fops)\n");
	is_dev = video_drvdata(file);
	return vb2_mmap(&is_dev->video[FIMC_IS_VIDEO_NUM_BAYER].vbq, vma);
}
static int mxr_video_mmap(struct file *file, struct vm_area_struct *vma)
{
	struct mxr_layer *layer = video_drvdata(file);

	mxr_dbg(layer->mdev, "%s:%d\n", __func__, __LINE__);

	return vb2_mmap(&layer->vb_queue, vma);
}
Beispiel #6
0
static int pwc_video_mmap(struct file *file, struct vm_area_struct *vma)
{
	struct pwc_device *pdev = video_drvdata(file);

	if (pdev->capt_file != file)
		return -EBUSY;

	return vb2_mmap(&pdev->vb_queue, vma);
}
Beispiel #7
0
static int fimc_is_scc_video_mmap(struct file *file,
					struct vm_area_struct *vma)
{
	struct fimc_is_video_ctx *video_ctx = file->private_data;

	dbg("%s\n", __func__);
	return vb2_mmap(&video_ctx->vbq, vma);

}
Beispiel #8
0
static int at91sam9x5_video_mmap(struct file *filp, struct vm_area_struct *vma)
{
	struct video_device *vdev = video_devdata(filp);
	struct at91sam9x5_video_priv *priv = video_get_drvdata(vdev);

	dev_dbg(&vdev->dev, "%s\n", __func__);

	/* returning -EIO here makes gst-launch segfault */
	return vb2_mmap(&priv->queue, vma);
}
Beispiel #9
0
int uvcg_queue_mmap(struct uvc_video_queue *queue, struct vm_area_struct *vma)
{
	int ret;

	mutex_lock(&queue->mutex);
	ret = vb2_mmap(&queue->queue, vma);
	mutex_unlock(&queue->mutex);

	return ret;
}
Beispiel #10
0
static int xvip_dma_mmap(struct file *file, struct vm_area_struct *vma)
{
	struct v4l2_fh *vfh = file->private_data;
	struct xvip_dma *dma = to_xvip_dma(vfh->vdev);
	int ret;

	mutex_lock(&dma->lock);
	ret = vb2_mmap(&dma->queue, vma);
	mutex_unlock(&dma->lock);

	return ret;
}
Beispiel #11
0
int dvb_vb2_mmap(struct dvb_vb2_ctx *ctx, struct vm_area_struct *vma)
{
	int ret;

	ret = vb2_mmap(&ctx->vb_q, vma);
	if (ret) {
		dprintk(1, "[%s] errno=%d\n", ctx->name, ret);
		return ret;
	}
	dprintk(3, "[%s] ret=%d\n", ctx->name, ret);

	return 0;
}
Beispiel #12
0
static int fimc_lite_mmap(struct file *file, struct vm_area_struct *vma)
{
	struct fimc_lite *fimc = video_drvdata(file);
	int ret;

	if (mutex_lock_interruptible(&fimc->lock))
		return -ERESTARTSYS;

	ret = vb2_mmap(&fimc->vb_queue, vma);
	mutex_unlock(&fimc->lock);

	return ret;
}
Beispiel #13
0
/**
 * v4l2_m2m_mmap() - source and destination queues-aware mmap multiplexer
 *
 * Call from driver's mmap() function. Will handle mmap() for both queues
 * seamlessly for videobuffer, which will receive normal per-queue offsets and
 * proper videobuf queue pointers. The differentiation is made outside videobuf
 * by adding a predefined offset to buffers from one of the queues and
 * subtracting it before passing it back to videobuf. Only drivers (and
 * thus applications) receive modified offsets.
 */
int v4l2_m2m_mmap(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
			 struct vm_area_struct *vma)
{
	unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
	struct vb2_queue *vq;

	if (offset < DST_QUEUE_OFF_BASE) {
		vq = v4l2_m2m_get_src_vq(m2m_ctx);
	} else {
		vq = v4l2_m2m_get_dst_vq(m2m_ctx);
		vma->vm_pgoff -= (DST_QUEUE_OFF_BASE >> PAGE_SHIFT);
	}

	return vb2_mmap(vq, vma);
}
int fimc_is_video_mmap(struct file *file,
	struct fimc_is_video_ctx *vctx,
	struct vm_area_struct *vma)
{
	u32 ret = 0;
	struct fimc_is_queue *queue;

	BUG_ON(!vctx);

	queue = GET_QUEUE(vctx);

	ret = vb2_mmap(queue->vbq, vma);

	return ret;
}
Beispiel #15
0
int vb2_fop_mmap(struct file *file, struct vm_area_struct *vma)
{
	struct video_device *vdev = video_devdata(file);

	return vb2_mmap(vdev->queue, vma);
}
Beispiel #16
0
int uvcg_queue_mmap(struct uvc_video_queue *queue, struct vm_area_struct *vma)
{
	return vb2_mmap(&queue->queue, vma);
}
Beispiel #17
0
static int fimc_capture_mmap(struct file *file, struct vm_area_struct *vma)
{
	struct fimc_dev *fimc = video_drvdata(file);

	return vb2_mmap(&fimc->vid_cap.vbq, vma);
}
Beispiel #18
0
static int gsc_capture_mmap(struct file *file, struct vm_area_struct *vma)
{
	struct gsc_dev *gsc = video_drvdata(file);

	return vb2_mmap(&gsc->cap.vbq, vma);
}
Beispiel #19
0
static int nxp_video_mmap(struct file *file, struct vm_area_struct *vma)
{
    struct nxp_video *me = file->private_data;
    return vb2_mmap(me->vbq, vma);
}
Beispiel #20
0
static int iss_video_mmap(struct file *file, struct vm_area_struct *vma)
{
	struct iss_video_fh *vfh = to_iss_video_fh(file->private_data);

	return vb2_mmap(&vfh->queue, vma);
}