[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> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:

committed by
Mauro Carvalho Chehab

parent
8e9bca3a26
commit
c781e4a565
@@ -440,7 +440,6 @@ static int queue_setup(struct vb2_queue *vq,
|
||||
unsigned int sizes[], void *allocators[])
|
||||
{
|
||||
struct camif_vp *vp = vb2_get_drv_priv(vq);
|
||||
struct camif_dev *camif = vp->camif;
|
||||
struct camif_frame *frame = &vp->out_frame;
|
||||
const struct camif_fmt *fmt = vp->out_fmt;
|
||||
unsigned int size;
|
||||
@@ -449,7 +448,6 @@ static int queue_setup(struct vb2_queue *vq,
|
||||
return -EINVAL;
|
||||
|
||||
size = (frame->f_width * frame->f_height * fmt->depth) / 8;
|
||||
allocators[0] = camif->alloc_ctx;
|
||||
|
||||
if (*num_planes)
|
||||
return sizes[0] < size ? -EINVAL : 0;
|
||||
@@ -1138,6 +1136,7 @@ int s3c_camif_register_video_node(struct camif_dev *camif, int idx)
|
||||
q->drv_priv = vp;
|
||||
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
|
||||
q->lock = &vp->camif->lock;
|
||||
q->dev = camif->v4l2_dev.dev;
|
||||
|
||||
ret = vb2_queue_init(q);
|
||||
if (ret)
|
||||
|
@@ -474,16 +474,9 @@ static int s3c_camif_probe(struct platform_device *pdev)
|
||||
if (ret < 0)
|
||||
goto err_pm;
|
||||
|
||||
/* Initialize contiguous memory allocator */
|
||||
camif->alloc_ctx = vb2_dma_contig_init_ctx(dev);
|
||||
if (IS_ERR(camif->alloc_ctx)) {
|
||||
ret = PTR_ERR(camif->alloc_ctx);
|
||||
goto err_alloc;
|
||||
}
|
||||
|
||||
ret = camif_media_dev_init(camif);
|
||||
if (ret < 0)
|
||||
goto err_mdev;
|
||||
goto err_alloc;
|
||||
|
||||
ret = camif_register_sensor(camif);
|
||||
if (ret < 0)
|
||||
@@ -517,8 +510,6 @@ err_sens:
|
||||
media_device_unregister(&camif->media_dev);
|
||||
media_device_cleanup(&camif->media_dev);
|
||||
camif_unregister_media_entities(camif);
|
||||
err_mdev:
|
||||
vb2_dma_contig_cleanup_ctx(camif->alloc_ctx);
|
||||
err_alloc:
|
||||
pm_runtime_put(dev);
|
||||
pm_runtime_disable(dev);
|
||||
|
@@ -254,7 +254,6 @@ struct camif_vp {
|
||||
* @ctrl_handler: v4l2 control handler (owned by @subdev)
|
||||
* @test_pattern: test pattern controls
|
||||
* @vp: video path (DMA) description (codec/preview)
|
||||
* @alloc_ctx: memory buffer allocator context
|
||||
* @variant: variant information for this device
|
||||
* @dev: pointer to the CAMIF device struct
|
||||
* @pdata: a copy of the driver's platform data
|
||||
@@ -291,7 +290,6 @@ struct camif_dev {
|
||||
u8 colorfx_cr;
|
||||
|
||||
struct camif_vp vp[CAMIF_VP_NUM];
|
||||
struct vb2_alloc_ctx *alloc_ctx;
|
||||
|
||||
const struct s3c_camif_variant *variant;
|
||||
struct device *dev;
|
||||
|
Reference in New Issue
Block a user