Commit 6eaff06a authored by Tomi Valkeinen's avatar Tomi Valkeinen Committed by Mauro Carvalho Chehab

media: drivers: use video_device_pipeline_alloc_start()

Use video_device_pipeline_alloc_start() instead of manually
allocating/managing the media pipeline storage.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent d9f44345
......@@ -1244,8 +1244,6 @@ static int rvin_mc_validate_format(struct rvin_dev *vin, struct v4l2_subdev *sd,
static int rvin_set_stream(struct rvin_dev *vin, int on)
{
struct media_pipeline *pipe;
struct media_device *mdev;
struct v4l2_subdev *sd;
struct media_pad *pad;
int ret;
......@@ -1273,17 +1271,7 @@ static int rvin_set_stream(struct rvin_dev *vin, int on)
if (ret)
return ret;
/*
* The graph lock needs to be taken to protect concurrent
* starts of multiple VIN instances as they might share
* a common subdevice down the line and then should use
* the same pipe.
*/
mdev = vin->vdev.entity.graph_obj.mdev;
mutex_lock(&mdev->graph_mutex);
pipe = media_entity_pipeline(&sd->entity) ? : &vin->vdev.pipe;
ret = __video_device_pipeline_start(&vin->vdev, pipe);
mutex_unlock(&mdev->graph_mutex);
ret = video_device_pipeline_alloc_start(&vin->vdev);
if (ret)
return ret;
......
......@@ -266,7 +266,7 @@ static int sun4i_csi_start_streaming(struct vb2_queue *vq, unsigned int count)
goto err_clear_dma_queue;
}
ret = video_device_pipeline_start(&csi->vdev, &csi->vdev.pipe);
ret = video_device_pipeline_alloc_start(&csi->vdev);
if (ret < 0)
goto err_free_scratch_buffer;
......
......@@ -141,7 +141,7 @@ static int sun6i_video_start_streaming(struct vb2_queue *vq, unsigned int count)
video->sequence = 0;
ret = video_device_pipeline_start(&video->vdev, &video->vdev.pipe);
ret = video_device_pipeline_alloc_start(&video->vdev);
if (ret < 0)
goto clear_dma_queue;
......
......@@ -708,7 +708,7 @@ static int cal_start_streaming(struct vb2_queue *vq, unsigned int count)
dma_addr_t addr;
int ret;
ret = video_device_pipeline_start(&ctx->vdev, &ctx->phy->pipe);
ret = video_device_pipeline_alloc_start(&ctx->vdev);
if (ret < 0) {
ctx_err(ctx, "Failed to start media pipeline: %d\n", ret);
goto error_release_buffers;
......
......@@ -174,7 +174,6 @@ struct cal_camerarx {
struct device_node *source_ep_node;
struct device_node *source_node;
struct v4l2_subdev *source;
struct media_pipeline pipe;
struct v4l2_subdev subdev;
struct media_pad pads[CAL_CAMERARX_NUM_PADS];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment