diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2016-02-15 13:24:11 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-07-08 14:40:07 -0300 |
commit | dce57314b53760b6f9190c98287ce8f89c80d233 (patch) | |
tree | 073ec63d99ac161ef64d4308efbc85e9448f129d /drivers/media/platform/sti | |
parent | 53ddcc683faef8c730c7162fa1ef2261a385d16d (diff) |
[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: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Benoit Parrot <bparrot@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/sti')
-rw-r--r-- | drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 18 | ||||
-rw-r--r-- | drivers/media/platform/sti/bdisp/bdisp.h | 2 |
2 files changed, 4 insertions, 16 deletions
diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c index d12a419c044a..b3e8b5afeb61 100644 --- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c +++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c @@ -439,7 +439,7 @@ static void bdisp_ctrls_delete(struct bdisp_ctx *ctx) static int bdisp_queue_setup(struct vb2_queue *vq, unsigned int *nb_buf, unsigned int *nb_planes, - unsigned int sizes[], void *allocators[]) + unsigned int sizes[], void *alloc_ctxs[]) { struct bdisp_ctx *ctx = vb2_get_drv_priv(vq); struct bdisp_frame *frame = ctx_get_frame(ctx, vq->type); @@ -453,7 +453,6 @@ static int bdisp_queue_setup(struct vb2_queue *vq, dev_err(ctx->bdisp_dev->dev, "Invalid format\n"); return -EINVAL; } - allocators[0] = ctx->bdisp_dev->alloc_ctx; if (*nb_planes) return sizes[0] < frame->sizeimage ? -EINVAL : 0; @@ -553,6 +552,7 @@ static int queue_init(void *priv, src_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; src_vq->lock = &ctx->bdisp_dev->lock; + src_vq->dev = ctx->bdisp_dev->v4l2_dev.dev; ret = vb2_queue_init(src_vq); if (ret) @@ -567,6 +567,7 @@ static int queue_init(void *priv, dst_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; dst_vq->lock = &ctx->bdisp_dev->lock; + dst_vq->dev = ctx->bdisp_dev->v4l2_dev.dev; return vb2_queue_init(dst_vq); } @@ -1269,8 +1270,6 @@ static int bdisp_remove(struct platform_device *pdev) bdisp_hw_free_filters(bdisp->dev); - vb2_dma_contig_cleanup_ctx(bdisp->alloc_ctx); - pm_runtime_disable(&pdev->dev); bdisp_debugfs_remove(bdisp); @@ -1371,18 +1370,11 @@ static int bdisp_probe(struct platform_device *pdev) goto err_dbg; } - /* Continuous memory allocator */ - bdisp->alloc_ctx = vb2_dma_contig_init_ctx(dev); - if (IS_ERR(bdisp->alloc_ctx)) { - ret = PTR_ERR(bdisp->alloc_ctx); - goto err_pm; - } - /* Filters */ if (bdisp_hw_alloc_filters(bdisp->dev)) { dev_err(bdisp->dev, "no memory for filters\n"); ret = -ENOMEM; - goto err_vb2_dma; + goto err_pm; } /* Register */ @@ -1401,8 +1393,6 @@ static int bdisp_probe(struct platform_device *pdev) err_filter: bdisp_hw_free_filters(bdisp->dev); -err_vb2_dma: - vb2_dma_contig_cleanup_ctx(bdisp->alloc_ctx); err_pm: pm_runtime_put(dev); err_dbg: diff --git a/drivers/media/platform/sti/bdisp/bdisp.h b/drivers/media/platform/sti/bdisp/bdisp.h index 0cf98577222c..b3fbf9902595 100644 --- a/drivers/media/platform/sti/bdisp/bdisp.h +++ b/drivers/media/platform/sti/bdisp/bdisp.h @@ -175,7 +175,6 @@ struct bdisp_dbg { * @id: device index * @m2m: memory-to-memory V4L2 device information * @state: flags used to synchronize m2m and capture mode operation - * @alloc_ctx: videobuf2 memory allocator context * @clock: IP clock * @regs: registers * @irq_queue: interrupt handler waitqueue @@ -193,7 +192,6 @@ struct bdisp_dev { u16 id; struct bdisp_m2m_device m2m; unsigned long state; - struct vb2_alloc_ctx *alloc_ctx; struct clk *clock; void __iomem *regs; wait_queue_head_t irq_queue; |