diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2016-02-15 16:09:10 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-07-08 19:39:21 +0200 |
commit | 53ddcc683faef8c730c7162fa1ef2261a385d16d (patch) | |
tree | 657e3cbb9136b0bee5ef6680137067c15e4fb6b7 /drivers/media/platform/rcar-vin | |
parent | [media] staging/media: convert drivers to use the new vb2_queue dev field (diff) | |
download | linux-53ddcc683faef8c730c7162fa1ef2261a385d16d.tar.xz linux-53ddcc683faef8c730c7162fa1ef2261a385d16d.zip |
[media] media/platform: convert drivers to use the new vb2_queue dev field
Stop using alloc_ctx and just fill in the device pointer.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Cc: Scott Jiang <scott.jiang.linux@gmail.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/rcar-vin')
-rw-r--r-- | drivers/media/platform/rcar-vin/rcar-dma.c | 11 | ||||
-rw-r--r-- | drivers/media/platform/rcar-vin/rcar-vin.h | 2 |
2 files changed, 1 insertions, 12 deletions
diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c index dad3b031f778..4c5c529aafa7 100644 --- a/drivers/media/platform/rcar-vin/rcar-dma.c +++ b/drivers/media/platform/rcar-vin/rcar-dma.c @@ -979,7 +979,6 @@ static int rvin_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, { struct rvin_dev *vin = vb2_get_drv_priv(vq); - alloc_ctxs[0] = vin->alloc_ctx; /* Make sure the image size is large enough. */ if (*nplanes) return sizes[0] < vin->format.sizeimage ? -EINVAL : 0; @@ -1129,9 +1128,6 @@ static struct vb2_ops rvin_qops = { void rvin_dma_remove(struct rvin_dev *vin) { - if (!IS_ERR_OR_NULL(vin->alloc_ctx)) - vb2_dma_contig_cleanup_ctx(vin->alloc_ctx); - mutex_destroy(&vin->lock); v4l2_device_unregister(&vin->v4l2_dev); @@ -1158,12 +1154,6 @@ int rvin_dma_probe(struct rvin_dev *vin, int irq) vin->queue_buf[i] = NULL; /* buffer queue */ - vin->alloc_ctx = vb2_dma_contig_init_ctx(vin->dev); - if (IS_ERR(vin->alloc_ctx)) { - ret = PTR_ERR(vin->alloc_ctx); - goto error; - } - q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; q->io_modes = VB2_MMAP | VB2_READ | VB2_DMABUF; q->lock = &vin->lock; @@ -1173,6 +1163,7 @@ int rvin_dma_probe(struct rvin_dev *vin, int irq) q->mem_ops = &vb2_dma_contig_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->min_buffers_needed = 2; + q->dev = vin->dev; ret = vb2_queue_init(q); if (ret < 0) { diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h b/drivers/media/platform/rcar-vin/rcar-vin.h index a6dd6db246ab..31ad39a39937 100644 --- a/drivers/media/platform/rcar-vin/rcar-vin.h +++ b/drivers/media/platform/rcar-vin/rcar-vin.h @@ -94,7 +94,6 @@ struct rvin_graph_entity { * * @lock: protects @queue * @queue: vb2 buffers queue - * @alloc_ctx: allocation context for the vb2 @queue * * @qlock: protects @queue_buf, @buf_list, @continuous, @sequence * @state @@ -125,7 +124,6 @@ struct rvin_dev { struct mutex lock; struct vb2_queue queue; - struct vb2_alloc_ctx *alloc_ctx; spinlock_t qlock; struct vb2_v4l2_buffer *queue_buf[HW_BUFFER_NUM]; |