diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2016-02-15 10:09:10 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-07-08 13:39:21 -0400 |
commit | 53ddcc683faef8c730c7162fa1ef2261a385d16d (patch) | |
tree | 657e3cbb9136b0bee5ef6680137067c15e4fb6b7 /drivers/media/platform/coda | |
parent | 57813da417f9c9aff1299a24182f590deac08c19 (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: 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/coda')
-rw-r--r-- | drivers/media/platform/coda/coda-common.c | 16 | ||||
-rw-r--r-- | drivers/media/platform/coda/coda.h | 1 |
2 files changed, 2 insertions, 15 deletions
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index 133ab9f70f85..3d57c352cefa 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c | |||
@@ -1151,9 +1151,6 @@ static int coda_queue_setup(struct vb2_queue *vq, | |||
1151 | *nplanes = 1; | 1151 | *nplanes = 1; |
1152 | sizes[0] = size; | 1152 | sizes[0] = size; |
1153 | 1153 | ||
1154 | /* Set to vb2-dma-contig allocator context, ignored by vb2-vmalloc */ | ||
1155 | alloc_ctxs[0] = ctx->dev->alloc_ctx; | ||
1156 | |||
1157 | v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev, | 1154 | v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev, |
1158 | "get %d buffer(s) of size %d each.\n", *nbuffers, size); | 1155 | "get %d buffer(s) of size %d each.\n", *nbuffers, size); |
1159 | 1156 | ||
@@ -1599,6 +1596,7 @@ static int coda_queue_init(struct coda_ctx *ctx, struct vb2_queue *vq) | |||
1599 | * that videobuf2 will keep the value of bytesused intact. | 1596 | * that videobuf2 will keep the value of bytesused intact. |
1600 | */ | 1597 | */ |
1601 | vq->allow_zero_bytesused = 1; | 1598 | vq->allow_zero_bytesused = 1; |
1599 | vq->dev = &ctx->dev->plat_dev->dev; | ||
1602 | 1600 | ||
1603 | return vb2_queue_init(vq); | 1601 | return vb2_queue_init(vq); |
1604 | } | 1602 | } |
@@ -2040,16 +2038,10 @@ static void coda_fw_callback(const struct firmware *fw, void *context) | |||
2040 | if (ret < 0) | 2038 | if (ret < 0) |
2041 | goto put_pm; | 2039 | goto put_pm; |
2042 | 2040 | ||
2043 | dev->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev); | ||
2044 | if (IS_ERR(dev->alloc_ctx)) { | ||
2045 | v4l2_err(&dev->v4l2_dev, "Failed to alloc vb2 context\n"); | ||
2046 | goto put_pm; | ||
2047 | } | ||
2048 | |||
2049 | dev->m2m_dev = v4l2_m2m_init(&coda_m2m_ops); | 2041 | dev->m2m_dev = v4l2_m2m_init(&coda_m2m_ops); |
2050 | if (IS_ERR(dev->m2m_dev)) { | 2042 | if (IS_ERR(dev->m2m_dev)) { |
2051 | v4l2_err(&dev->v4l2_dev, "Failed to init mem2mem device\n"); | 2043 | v4l2_err(&dev->v4l2_dev, "Failed to init mem2mem device\n"); |
2052 | goto rel_ctx; | 2044 | goto put_pm; |
2053 | } | 2045 | } |
2054 | 2046 | ||
2055 | for (i = 0; i < dev->devtype->num_vdevs; i++) { | 2047 | for (i = 0; i < dev->devtype->num_vdevs; i++) { |
@@ -2072,8 +2064,6 @@ rel_vfd: | |||
2072 | while (--i >= 0) | 2064 | while (--i >= 0) |
2073 | video_unregister_device(&dev->vfd[i]); | 2065 | video_unregister_device(&dev->vfd[i]); |
2074 | v4l2_m2m_release(dev->m2m_dev); | 2066 | v4l2_m2m_release(dev->m2m_dev); |
2075 | rel_ctx: | ||
2076 | vb2_dma_contig_cleanup_ctx(dev->alloc_ctx); | ||
2077 | put_pm: | 2067 | put_pm: |
2078 | pm_runtime_put_sync(&pdev->dev); | 2068 | pm_runtime_put_sync(&pdev->dev); |
2079 | } | 2069 | } |
@@ -2324,8 +2314,6 @@ static int coda_remove(struct platform_device *pdev) | |||
2324 | if (dev->m2m_dev) | 2314 | if (dev->m2m_dev) |
2325 | v4l2_m2m_release(dev->m2m_dev); | 2315 | v4l2_m2m_release(dev->m2m_dev); |
2326 | pm_runtime_disable(&pdev->dev); | 2316 | pm_runtime_disable(&pdev->dev); |
2327 | if (dev->alloc_ctx) | ||
2328 | vb2_dma_contig_cleanup_ctx(dev->alloc_ctx); | ||
2329 | v4l2_device_unregister(&dev->v4l2_dev); | 2317 | v4l2_device_unregister(&dev->v4l2_dev); |
2330 | destroy_workqueue(dev->workqueue); | 2318 | destroy_workqueue(dev->workqueue); |
2331 | if (dev->iram.vaddr) | 2319 | if (dev->iram.vaddr) |
diff --git a/drivers/media/platform/coda/coda.h b/drivers/media/platform/coda/coda.h index 8f2c71e06966..53f96661683c 100644 --- a/drivers/media/platform/coda/coda.h +++ b/drivers/media/platform/coda/coda.h | |||
@@ -92,7 +92,6 @@ struct coda_dev { | |||
92 | struct mutex coda_mutex; | 92 | struct mutex coda_mutex; |
93 | struct workqueue_struct *workqueue; | 93 | struct workqueue_struct *workqueue; |
94 | struct v4l2_m2m_dev *m2m_dev; | 94 | struct v4l2_m2m_dev *m2m_dev; |
95 | struct vb2_alloc_ctx *alloc_ctx; | ||
96 | struct list_head instances; | 95 | struct list_head instances; |
97 | unsigned long instance_mask; | 96 | unsigned long instance_mask; |
98 | struct dentry *debugfs_root; | 97 | struct dentry *debugfs_root; |