Commit 12cecbf9 authored by Tomi Valkeinen's avatar Tomi Valkeinen Committed by Mauro Carvalho Chehab

media: drivers: use video device pipeline start/stop

Convert the media drivers to use video device based pipeline start/stop
where possible.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 340eba47
...@@ -989,7 +989,7 @@ static int cio2_vb2_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -989,7 +989,7 @@ static int cio2_vb2_start_streaming(struct vb2_queue *vq, unsigned int count)
return r; return r;
} }
r = media_pipeline_start(&q->vdev.entity, &q->pipe); r = video_device_pipeline_start(&q->vdev, &q->pipe);
if (r) if (r)
goto fail_pipeline; goto fail_pipeline;
...@@ -1009,7 +1009,7 @@ static int cio2_vb2_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -1009,7 +1009,7 @@ static int cio2_vb2_start_streaming(struct vb2_queue *vq, unsigned int count)
fail_csi2_subdev: fail_csi2_subdev:
cio2_hw_exit(cio2, q); cio2_hw_exit(cio2, q);
fail_hw: fail_hw:
media_pipeline_stop(&q->vdev.entity); video_device_pipeline_stop(&q->vdev);
fail_pipeline: fail_pipeline:
dev_dbg(dev, "failed to start streaming (%d)\n", r); dev_dbg(dev, "failed to start streaming (%d)\n", r);
cio2_vb2_return_all_buffers(q, VB2_BUF_STATE_QUEUED); cio2_vb2_return_all_buffers(q, VB2_BUF_STATE_QUEUED);
...@@ -1030,7 +1030,7 @@ static void cio2_vb2_stop_streaming(struct vb2_queue *vq) ...@@ -1030,7 +1030,7 @@ static void cio2_vb2_stop_streaming(struct vb2_queue *vq)
cio2_hw_exit(cio2, q); cio2_hw_exit(cio2, q);
synchronize_irq(cio2->pci_dev->irq); synchronize_irq(cio2->pci_dev->irq);
cio2_vb2_return_all_buffers(q, VB2_BUF_STATE_ERROR); cio2_vb2_return_all_buffers(q, VB2_BUF_STATE_ERROR);
media_pipeline_stop(&q->vdev.entity); video_device_pipeline_stop(&q->vdev);
pm_runtime_put(dev); pm_runtime_put(dev);
cio2->streaming = false; cio2->streaming = false;
} }
......
...@@ -493,7 +493,7 @@ static int video_start_streaming(struct vb2_queue *q, unsigned int count) ...@@ -493,7 +493,7 @@ static int video_start_streaming(struct vb2_queue *q, unsigned int count)
struct v4l2_subdev *subdev; struct v4l2_subdev *subdev;
int ret; int ret;
ret = media_pipeline_start(&vdev->entity, &video->pipe); ret = video_device_pipeline_start(vdev, &video->pipe);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -522,7 +522,7 @@ static int video_start_streaming(struct vb2_queue *q, unsigned int count) ...@@ -522,7 +522,7 @@ static int video_start_streaming(struct vb2_queue *q, unsigned int count)
return 0; return 0;
error: error:
media_pipeline_stop(&vdev->entity); video_device_pipeline_stop(vdev);
video->ops->flush_buffers(video, VB2_BUF_STATE_QUEUED); video->ops->flush_buffers(video, VB2_BUF_STATE_QUEUED);
...@@ -553,7 +553,7 @@ static void video_stop_streaming(struct vb2_queue *q) ...@@ -553,7 +553,7 @@ static void video_stop_streaming(struct vb2_queue *q)
v4l2_subdev_call(subdev, video, s_stream, 0); v4l2_subdev_call(subdev, video, s_stream, 0);
} }
media_pipeline_stop(&vdev->entity); video_device_pipeline_stop(vdev);
video->ops->flush_buffers(video, VB2_BUF_STATE_ERROR); video->ops->flush_buffers(video, VB2_BUF_STATE_ERROR);
} }
......
...@@ -1265,7 +1265,7 @@ static int rvin_set_stream(struct rvin_dev *vin, int on) ...@@ -1265,7 +1265,7 @@ static int rvin_set_stream(struct rvin_dev *vin, int on)
sd = media_entity_to_v4l2_subdev(pad->entity); sd = media_entity_to_v4l2_subdev(pad->entity);
if (!on) { if (!on) {
media_pipeline_stop(&vin->vdev.entity); video_device_pipeline_stop(&vin->vdev);
return v4l2_subdev_call(sd, video, s_stream, 0); return v4l2_subdev_call(sd, video, s_stream, 0);
} }
...@@ -1282,7 +1282,7 @@ static int rvin_set_stream(struct rvin_dev *vin, int on) ...@@ -1282,7 +1282,7 @@ static int rvin_set_stream(struct rvin_dev *vin, int on)
mdev = vin->vdev.entity.graph_obj.mdev; mdev = vin->vdev.entity.graph_obj.mdev;
mutex_lock(&mdev->graph_mutex); mutex_lock(&mdev->graph_mutex);
pipe = media_entity_pipeline(&sd->entity) ? : &vin->vdev.pipe; pipe = media_entity_pipeline(&sd->entity) ? : &vin->vdev.pipe;
ret = __media_pipeline_start(&vin->vdev.entity, pipe); ret = __video_device_pipeline_start(&vin->vdev, pipe);
mutex_unlock(&mdev->graph_mutex); mutex_unlock(&mdev->graph_mutex);
if (ret) if (ret)
return ret; return ret;
...@@ -1291,7 +1291,7 @@ static int rvin_set_stream(struct rvin_dev *vin, int on) ...@@ -1291,7 +1291,7 @@ static int rvin_set_stream(struct rvin_dev *vin, int on)
if (ret == -ENOIOCTLCMD) if (ret == -ENOIOCTLCMD)
ret = 0; ret = 0;
if (ret) if (ret)
media_pipeline_stop(&vin->vdev.entity); video_device_pipeline_stop(&vin->vdev);
return ret; return ret;
} }
......
...@@ -927,7 +927,7 @@ static void vsp1_video_stop_streaming(struct vb2_queue *vq) ...@@ -927,7 +927,7 @@ static void vsp1_video_stop_streaming(struct vb2_queue *vq)
} }
mutex_unlock(&pipe->lock); mutex_unlock(&pipe->lock);
media_pipeline_stop(&video->video.entity); video_device_pipeline_stop(&video->video);
vsp1_video_release_buffers(video); vsp1_video_release_buffers(video);
vsp1_video_pipeline_put(pipe); vsp1_video_pipeline_put(pipe);
} }
...@@ -1046,7 +1046,7 @@ vsp1_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type) ...@@ -1046,7 +1046,7 @@ vsp1_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
return PTR_ERR(pipe); return PTR_ERR(pipe);
} }
ret = __media_pipeline_start(&video->video.entity, &pipe->pipe); ret = __video_device_pipeline_start(&video->video, &pipe->pipe);
if (ret < 0) { if (ret < 0) {
mutex_unlock(&mdev->graph_mutex); mutex_unlock(&mdev->graph_mutex);
goto err_pipe; goto err_pipe;
...@@ -1070,7 +1070,7 @@ vsp1_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type) ...@@ -1070,7 +1070,7 @@ vsp1_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
return 0; return 0;
err_stop: err_stop:
media_pipeline_stop(&video->video.entity); video_device_pipeline_stop(&video->video);
err_pipe: err_pipe:
vsp1_video_pipeline_put(pipe); vsp1_video_pipeline_put(pipe);
return ret; return ret;
......
...@@ -913,7 +913,7 @@ static void rkisp1_cap_stream_disable(struct rkisp1_capture *cap) ...@@ -913,7 +913,7 @@ static void rkisp1_cap_stream_disable(struct rkisp1_capture *cap)
* *
* Call s_stream(false) in the reverse order from * Call s_stream(false) in the reverse order from
* rkisp1_pipeline_stream_enable() and disable the DMA engine. * rkisp1_pipeline_stream_enable() and disable the DMA engine.
* Should be called before media_pipeline_stop() * Should be called before video_device_pipeline_stop()
*/ */
static void rkisp1_pipeline_stream_disable(struct rkisp1_capture *cap) static void rkisp1_pipeline_stream_disable(struct rkisp1_capture *cap)
__must_hold(&cap->rkisp1->stream_lock) __must_hold(&cap->rkisp1->stream_lock)
...@@ -937,7 +937,7 @@ static void rkisp1_pipeline_stream_disable(struct rkisp1_capture *cap) ...@@ -937,7 +937,7 @@ static void rkisp1_pipeline_stream_disable(struct rkisp1_capture *cap)
* rkisp1_pipeline_stream_enable - enable nodes in the pipeline * rkisp1_pipeline_stream_enable - enable nodes in the pipeline
* *
* Enable the DMA Engine and call s_stream(true) through the pipeline. * Enable the DMA Engine and call s_stream(true) through the pipeline.
* Should be called after media_pipeline_start() * Should be called after video_device_pipeline_start()
*/ */
static int rkisp1_pipeline_stream_enable(struct rkisp1_capture *cap) static int rkisp1_pipeline_stream_enable(struct rkisp1_capture *cap)
__must_hold(&cap->rkisp1->stream_lock) __must_hold(&cap->rkisp1->stream_lock)
...@@ -994,7 +994,7 @@ static void rkisp1_vb2_stop_streaming(struct vb2_queue *queue) ...@@ -994,7 +994,7 @@ static void rkisp1_vb2_stop_streaming(struct vb2_queue *queue)
rkisp1_dummy_buf_destroy(cap); rkisp1_dummy_buf_destroy(cap);
media_pipeline_stop(&node->vdev.entity); video_device_pipeline_stop(&node->vdev);
mutex_unlock(&cap->rkisp1->stream_lock); mutex_unlock(&cap->rkisp1->stream_lock);
} }
...@@ -1008,7 +1008,7 @@ rkisp1_vb2_start_streaming(struct vb2_queue *queue, unsigned int count) ...@@ -1008,7 +1008,7 @@ rkisp1_vb2_start_streaming(struct vb2_queue *queue, unsigned int count)
mutex_lock(&cap->rkisp1->stream_lock); mutex_lock(&cap->rkisp1->stream_lock);
ret = media_pipeline_start(entity, &cap->rkisp1->pipe); ret = video_device_pipeline_start(&cap->vnode.vdev, &cap->rkisp1->pipe);
if (ret) { if (ret) {
dev_err(cap->rkisp1->dev, "start pipeline failed %d\n", ret); dev_err(cap->rkisp1->dev, "start pipeline failed %d\n", ret);
goto err_ret_buffers; goto err_ret_buffers;
...@@ -1044,7 +1044,7 @@ rkisp1_vb2_start_streaming(struct vb2_queue *queue, unsigned int count) ...@@ -1044,7 +1044,7 @@ rkisp1_vb2_start_streaming(struct vb2_queue *queue, unsigned int count)
err_destroy_dummy: err_destroy_dummy:
rkisp1_dummy_buf_destroy(cap); rkisp1_dummy_buf_destroy(cap);
err_pipeline_stop: err_pipeline_stop:
media_pipeline_stop(entity); video_device_pipeline_stop(&cap->vnode.vdev);
err_ret_buffers: err_ret_buffers:
rkisp1_return_all_buffers(cap, VB2_BUF_STATE_QUEUED); rkisp1_return_all_buffers(cap, VB2_BUF_STATE_QUEUED);
mutex_unlock(&cap->rkisp1->stream_lock); mutex_unlock(&cap->rkisp1->stream_lock);
......
...@@ -524,7 +524,7 @@ static int fimc_capture_release(struct file *file) ...@@ -524,7 +524,7 @@ static int fimc_capture_release(struct file *file)
mutex_lock(&fimc->lock); mutex_lock(&fimc->lock);
if (close && vc->streaming) { if (close && vc->streaming) {
media_pipeline_stop(&vc->ve.vdev.entity); video_device_pipeline_stop(&vc->ve.vdev);
vc->streaming = false; vc->streaming = false;
} }
...@@ -1176,7 +1176,6 @@ static int fimc_cap_streamon(struct file *file, void *priv, ...@@ -1176,7 +1176,6 @@ static int fimc_cap_streamon(struct file *file, void *priv,
{ {
struct fimc_dev *fimc = video_drvdata(file); struct fimc_dev *fimc = video_drvdata(file);
struct fimc_vid_cap *vc = &fimc->vid_cap; struct fimc_vid_cap *vc = &fimc->vid_cap;
struct media_entity *entity = &vc->ve.vdev.entity;
struct fimc_source_info *si = NULL; struct fimc_source_info *si = NULL;
struct v4l2_subdev *sd; struct v4l2_subdev *sd;
int ret; int ret;
...@@ -1184,7 +1183,7 @@ static int fimc_cap_streamon(struct file *file, void *priv, ...@@ -1184,7 +1183,7 @@ static int fimc_cap_streamon(struct file *file, void *priv,
if (fimc_capture_active(fimc)) if (fimc_capture_active(fimc))
return -EBUSY; return -EBUSY;
ret = media_pipeline_start(entity, &vc->ve.pipe->mp); ret = video_device_pipeline_start(&vc->ve.vdev, &vc->ve.pipe->mp);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -1218,7 +1217,7 @@ static int fimc_cap_streamon(struct file *file, void *priv, ...@@ -1218,7 +1217,7 @@ static int fimc_cap_streamon(struct file *file, void *priv,
} }
err_p_stop: err_p_stop:
media_pipeline_stop(entity); video_device_pipeline_stop(&vc->ve.vdev);
return ret; return ret;
} }
...@@ -1234,7 +1233,7 @@ static int fimc_cap_streamoff(struct file *file, void *priv, ...@@ -1234,7 +1233,7 @@ static int fimc_cap_streamoff(struct file *file, void *priv,
return ret; return ret;
if (vc->streaming) { if (vc->streaming) {
media_pipeline_stop(&vc->ve.vdev.entity); video_device_pipeline_stop(&vc->ve.vdev);
vc->streaming = false; vc->streaming = false;
} }
......
...@@ -312,7 +312,7 @@ static int isp_video_release(struct file *file) ...@@ -312,7 +312,7 @@ static int isp_video_release(struct file *file)
is_singular_file = v4l2_fh_is_singular_file(file); is_singular_file = v4l2_fh_is_singular_file(file);
if (is_singular_file && ivc->streaming) { if (is_singular_file && ivc->streaming) {
media_pipeline_stop(entity); video_device_pipeline_stop(&ivc->ve.vdev);
ivc->streaming = 0; ivc->streaming = 0;
} }
...@@ -490,10 +490,9 @@ static int isp_video_streamon(struct file *file, void *priv, ...@@ -490,10 +490,9 @@ static int isp_video_streamon(struct file *file, void *priv,
{ {
struct fimc_isp *isp = video_drvdata(file); struct fimc_isp *isp = video_drvdata(file);
struct exynos_video_entity *ve = &isp->video_capture.ve; struct exynos_video_entity *ve = &isp->video_capture.ve;
struct media_entity *me = &ve->vdev.entity;
int ret; int ret;
ret = media_pipeline_start(me, &ve->pipe->mp); ret = video_device_pipeline_start(&ve->vdev, &ve->pipe->mp);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -508,7 +507,7 @@ static int isp_video_streamon(struct file *file, void *priv, ...@@ -508,7 +507,7 @@ static int isp_video_streamon(struct file *file, void *priv,
isp->video_capture.streaming = 1; isp->video_capture.streaming = 1;
return 0; return 0;
p_stop: p_stop:
media_pipeline_stop(me); video_device_pipeline_stop(&ve->vdev);
return ret; return ret;
} }
...@@ -523,7 +522,7 @@ static int isp_video_streamoff(struct file *file, void *priv, ...@@ -523,7 +522,7 @@ static int isp_video_streamoff(struct file *file, void *priv,
if (ret < 0) if (ret < 0)
return ret; return ret;
media_pipeline_stop(&video->ve.vdev.entity); video_device_pipeline_stop(&video->ve.vdev);
video->streaming = 0; video->streaming = 0;
return 0; return 0;
} }
......
...@@ -516,7 +516,7 @@ static int fimc_lite_release(struct file *file) ...@@ -516,7 +516,7 @@ static int fimc_lite_release(struct file *file)
if (v4l2_fh_is_singular_file(file) && if (v4l2_fh_is_singular_file(file) &&
atomic_read(&fimc->out_path) == FIMC_IO_DMA) { atomic_read(&fimc->out_path) == FIMC_IO_DMA) {
if (fimc->streaming) { if (fimc->streaming) {
media_pipeline_stop(entity); video_device_pipeline_stop(&fimc->ve.vdev);
fimc->streaming = false; fimc->streaming = false;
} }
fimc_lite_stop_capture(fimc, false); fimc_lite_stop_capture(fimc, false);
...@@ -812,13 +812,12 @@ static int fimc_lite_streamon(struct file *file, void *priv, ...@@ -812,13 +812,12 @@ static int fimc_lite_streamon(struct file *file, void *priv,
enum v4l2_buf_type type) enum v4l2_buf_type type)
{ {
struct fimc_lite *fimc = video_drvdata(file); struct fimc_lite *fimc = video_drvdata(file);
struct media_entity *entity = &fimc->ve.vdev.entity;
int ret; int ret;
if (fimc_lite_active(fimc)) if (fimc_lite_active(fimc))
return -EBUSY; return -EBUSY;
ret = media_pipeline_start(entity, &fimc->ve.pipe->mp); ret = video_device_pipeline_start(&fimc->ve.vdev, &fimc->ve.pipe->mp);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -835,7 +834,7 @@ static int fimc_lite_streamon(struct file *file, void *priv, ...@@ -835,7 +834,7 @@ static int fimc_lite_streamon(struct file *file, void *priv,
} }
err_p_stop: err_p_stop:
media_pipeline_stop(entity); video_device_pipeline_stop(&fimc->ve.vdev);
return 0; return 0;
} }
...@@ -849,7 +848,7 @@ static int fimc_lite_streamoff(struct file *file, void *priv, ...@@ -849,7 +848,7 @@ static int fimc_lite_streamoff(struct file *file, void *priv,
if (ret < 0) if (ret < 0)
return ret; return ret;
media_pipeline_stop(&fimc->ve.vdev.entity); video_device_pipeline_stop(&fimc->ve.vdev);
fimc->streaming = false; fimc->streaming = false;
return 0; return 0;
} }
......
...@@ -751,7 +751,7 @@ static int dcmi_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -751,7 +751,7 @@ static int dcmi_start_streaming(struct vb2_queue *vq, unsigned int count)
goto err_unlocked; goto err_unlocked;
} }
ret = media_pipeline_start(&dcmi->vdev->entity, &dcmi->pipeline); ret = video_device_pipeline_start(dcmi->vdev, &dcmi->pipeline);
if (ret < 0) { if (ret < 0) {
dev_err(dcmi->dev, "%s: Failed to start streaming, media pipeline start error (%d)\n", dev_err(dcmi->dev, "%s: Failed to start streaming, media pipeline start error (%d)\n",
__func__, ret); __func__, ret);
...@@ -865,7 +865,7 @@ static int dcmi_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -865,7 +865,7 @@ static int dcmi_start_streaming(struct vb2_queue *vq, unsigned int count)
dcmi_pipeline_stop(dcmi); dcmi_pipeline_stop(dcmi);
err_media_pipeline_stop: err_media_pipeline_stop:
media_pipeline_stop(&dcmi->vdev->entity); video_device_pipeline_stop(dcmi->vdev);
err_pm_put: err_pm_put:
pm_runtime_put(dcmi->dev); pm_runtime_put(dcmi->dev);
...@@ -892,7 +892,7 @@ static void dcmi_stop_streaming(struct vb2_queue *vq) ...@@ -892,7 +892,7 @@ static void dcmi_stop_streaming(struct vb2_queue *vq)
dcmi_pipeline_stop(dcmi); dcmi_pipeline_stop(dcmi);
media_pipeline_stop(&dcmi->vdev->entity); video_device_pipeline_stop(dcmi->vdev);
spin_lock_irq(&dcmi->irqlock); spin_lock_irq(&dcmi->irqlock);
......
...@@ -266,7 +266,7 @@ static int sun4i_csi_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -266,7 +266,7 @@ static int sun4i_csi_start_streaming(struct vb2_queue *vq, unsigned int count)
goto err_clear_dma_queue; goto err_clear_dma_queue;
} }
ret = media_pipeline_start(&csi->vdev.entity, &csi->vdev.pipe); ret = video_device_pipeline_start(&csi->vdev, &csi->vdev.pipe);
if (ret < 0) if (ret < 0)
goto err_free_scratch_buffer; goto err_free_scratch_buffer;
...@@ -330,7 +330,7 @@ static int sun4i_csi_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -330,7 +330,7 @@ static int sun4i_csi_start_streaming(struct vb2_queue *vq, unsigned int count)
sun4i_csi_capture_stop(csi); sun4i_csi_capture_stop(csi);
err_disable_pipeline: err_disable_pipeline:
media_pipeline_stop(&csi->vdev.entity); video_device_pipeline_stop(&csi->vdev);
err_free_scratch_buffer: err_free_scratch_buffer:
dma_free_coherent(csi->dev, csi->scratch.size, csi->scratch.vaddr, dma_free_coherent(csi->dev, csi->scratch.size, csi->scratch.vaddr,
...@@ -359,7 +359,7 @@ static void sun4i_csi_stop_streaming(struct vb2_queue *vq) ...@@ -359,7 +359,7 @@ static void sun4i_csi_stop_streaming(struct vb2_queue *vq)
return_all_buffers(csi, VB2_BUF_STATE_ERROR); return_all_buffers(csi, VB2_BUF_STATE_ERROR);
spin_unlock_irqrestore(&csi->qlock, flags); spin_unlock_irqrestore(&csi->qlock, flags);
media_pipeline_stop(&csi->vdev.entity); video_device_pipeline_stop(&csi->vdev);
dma_free_coherent(csi->dev, csi->scratch.size, csi->scratch.vaddr, dma_free_coherent(csi->dev, csi->scratch.size, csi->scratch.vaddr,
csi->scratch.paddr); csi->scratch.paddr);
......
...@@ -141,7 +141,7 @@ static int sun6i_video_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -141,7 +141,7 @@ static int sun6i_video_start_streaming(struct vb2_queue *vq, unsigned int count)
video->sequence = 0; video->sequence = 0;
ret = media_pipeline_start(&video->vdev.entity, &video->vdev.pipe); ret = video_device_pipeline_start(&video->vdev, &video->vdev.pipe);
if (ret < 0) if (ret < 0)
goto clear_dma_queue; goto clear_dma_queue;
...@@ -207,7 +207,7 @@ static int sun6i_video_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -207,7 +207,7 @@ static int sun6i_video_start_streaming(struct vb2_queue *vq, unsigned int count)
stop_csi_stream: stop_csi_stream:
sun6i_csi_set_stream(video->csi, false); sun6i_csi_set_stream(video->csi, false);
stop_media_pipeline: stop_media_pipeline:
media_pipeline_stop(&video->vdev.entity); video_device_pipeline_stop(&video->vdev);
clear_dma_queue: clear_dma_queue:
spin_lock_irqsave(&video->dma_queue_lock, flags); spin_lock_irqsave(&video->dma_queue_lock, flags);
list_for_each_entry(buf, &video->dma_queue, list) list_for_each_entry(buf, &video->dma_queue, list)
...@@ -231,7 +231,7 @@ static void sun6i_video_stop_streaming(struct vb2_queue *vq) ...@@ -231,7 +231,7 @@ static void sun6i_video_stop_streaming(struct vb2_queue *vq)
sun6i_csi_set_stream(video->csi, false); sun6i_csi_set_stream(video->csi, false);
media_pipeline_stop(&video->vdev.entity); video_device_pipeline_stop(&video->vdev);
/* Release all active buffers */ /* Release all active buffers */
spin_lock_irqsave(&video->dma_queue_lock, flags); spin_lock_irqsave(&video->dma_queue_lock, flags);
......
...@@ -708,7 +708,7 @@ static int cal_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -708,7 +708,7 @@ static int cal_start_streaming(struct vb2_queue *vq, unsigned int count)
dma_addr_t addr; dma_addr_t addr;
int ret; int ret;
ret = media_pipeline_start(&ctx->vdev.entity, &ctx->phy->pipe); ret = video_device_pipeline_start(&ctx->vdev, &ctx->phy->pipe);
if (ret < 0) { if (ret < 0) {
ctx_err(ctx, "Failed to start media pipeline: %d\n", ret); ctx_err(ctx, "Failed to start media pipeline: %d\n", ret);
goto error_release_buffers; goto error_release_buffers;
...@@ -761,7 +761,7 @@ static int cal_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -761,7 +761,7 @@ static int cal_start_streaming(struct vb2_queue *vq, unsigned int count)
cal_ctx_unprepare(ctx); cal_ctx_unprepare(ctx);
error_pipeline: error_pipeline:
media_pipeline_stop(&ctx->vdev.entity); video_device_pipeline_stop(&ctx->vdev);
error_release_buffers: error_release_buffers:
cal_release_buffers(ctx, VB2_BUF_STATE_QUEUED); cal_release_buffers(ctx, VB2_BUF_STATE_QUEUED);
...@@ -782,7 +782,7 @@ static void cal_stop_streaming(struct vb2_queue *vq) ...@@ -782,7 +782,7 @@ static void cal_stop_streaming(struct vb2_queue *vq)
cal_release_buffers(ctx, VB2_BUF_STATE_ERROR); cal_release_buffers(ctx, VB2_BUF_STATE_ERROR);
media_pipeline_stop(&ctx->vdev.entity); video_device_pipeline_stop(&ctx->vdev);
} }
static const struct vb2_ops cal_video_qops = { static const struct vb2_ops cal_video_qops = {
......
...@@ -1103,7 +1103,7 @@ isp_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type) ...@@ -1103,7 +1103,7 @@ isp_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
pipe->l3_ick = clk_get_rate(video->isp->clock[ISP_CLK_L3_ICK]); pipe->l3_ick = clk_get_rate(video->isp->clock[ISP_CLK_L3_ICK]);
pipe->max_rate = pipe->l3_ick; pipe->max_rate = pipe->l3_ick;
ret = media_pipeline_start(&video->video.entity, &pipe->pipe); ret = video_device_pipeline_start(&video->video, &pipe->pipe);
if (ret < 0) if (ret < 0)
goto err_pipeline_start; goto err_pipeline_start;
...@@ -1160,7 +1160,7 @@ isp_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type) ...@@ -1160,7 +1160,7 @@ isp_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
return 0; return 0;
err_check_format: err_check_format:
media_pipeline_stop(&video->video.entity); video_device_pipeline_stop(&video->video);
err_pipeline_start: err_pipeline_start:
/* TODO: Implement PM QoS */ /* TODO: Implement PM QoS */
/* The DMA queue must be emptied here, otherwise CCDC interrupts that /* The DMA queue must be emptied here, otherwise CCDC interrupts that
...@@ -1227,7 +1227,7 @@ isp_video_streamoff(struct file *file, void *fh, enum v4l2_buf_type type) ...@@ -1227,7 +1227,7 @@ isp_video_streamoff(struct file *file, void *fh, enum v4l2_buf_type type)
video->error = false; video->error = false;
/* TODO: Implement PM QoS */ /* TODO: Implement PM QoS */
media_pipeline_stop(&video->video.entity); video_device_pipeline_stop(&video->video);
media_entity_enum_cleanup(&pipe->ent_enum); media_entity_enum_cleanup(&pipe->ent_enum);
......
...@@ -404,7 +404,7 @@ static int xvip_dma_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -404,7 +404,7 @@ static int xvip_dma_start_streaming(struct vb2_queue *vq, unsigned int count)
*/ */
pipe = to_xvip_pipeline(&dma->video.entity) ? : &dma->pipe; pipe = to_xvip_pipeline(&dma->video.entity) ? : &dma->pipe;
ret = media_pipeline_start(&dma->video.entity, &pipe->pipe); ret = video_device_pipeline_start(&dma->video, &pipe->pipe);
if (ret < 0) if (ret < 0)
goto error; goto error;
...@@ -430,7 +430,7 @@ static int xvip_dma_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -430,7 +430,7 @@ static int xvip_dma_start_streaming(struct vb2_queue *vq, unsigned int count)
return 0; return 0;
error_stop: error_stop:
media_pipeline_stop(&dma->video.entity); video_device_pipeline_stop(&dma->video);
error: error:
/* Give back all queued buffers to videobuf2. */ /* Give back all queued buffers to videobuf2. */
...@@ -458,7 +458,7 @@ static void xvip_dma_stop_streaming(struct vb2_queue *vq) ...@@ -458,7 +458,7 @@ static void xvip_dma_stop_streaming(struct vb2_queue *vq)
/* Cleanup the pipeline and mark it as being stopped. */ /* Cleanup the pipeline and mark it as being stopped. */
xvip_pipeline_cleanup(pipe); xvip_pipeline_cleanup(pipe);
media_pipeline_stop(&dma->video.entity); video_device_pipeline_stop(&dma->video);
/* Give back all queued buffers to videobuf2. */ /* Give back all queued buffers to videobuf2. */
spin_lock_irq(&dma->queued_lock); spin_lock_irq(&dma->queued_lock);
......
...@@ -241,13 +241,12 @@ static void vimc_capture_return_all_buffers(struct vimc_capture_device *vcapture ...@@ -241,13 +241,12 @@ static void vimc_capture_return_all_buffers(struct vimc_capture_device *vcapture
static int vimc_capture_start_streaming(struct vb2_queue *vq, unsigned int count) static int vimc_capture_start_streaming(struct vb2_queue *vq, unsigned int count)
{ {
struct vimc_capture_device *vcapture = vb2_get_drv_priv(vq); struct vimc_capture_device *vcapture = vb2_get_drv_priv(vq);
struct media_entity *entity = &vcapture->vdev.entity;
int ret; int ret;
vcapture->sequence = 0; vcapture->sequence = 0;
/* Start the media pipeline */ /* Start the media pipeline */
ret = media_pipeline_start(entity, &vcapture->stream.pipe); ret = video_device_pipeline_start(&vcapture->vdev, &vcapture->stream.pipe);
if (ret) { if (ret) {
vimc_capture_return_all_buffers(vcapture, VB2_BUF_STATE_QUEUED); vimc_capture_return_all_buffers(vcapture, VB2_BUF_STATE_QUEUED);
return ret; return ret;
...@@ -255,7 +254,7 @@ static int vimc_capture_start_streaming(struct vb2_queue *vq, unsigned int count ...@@ -255,7 +254,7 @@ static int vimc_capture_start_streaming(struct vb2_queue *vq, unsigned int count
ret = vimc_streamer_s_stream(&vcapture->stream, &vcapture->ved, 1); ret = vimc_streamer_s_stream(&vcapture->stream, &vcapture->ved, 1);
if (ret) { if (ret) {
media_pipeline_stop(entity); video_device_pipeline_stop(&vcapture->vdev);
vimc_capture_return_all_buffers(vcapture, VB2_BUF_STATE_QUEUED); vimc_capture_return_all_buffers(vcapture, VB2_BUF_STATE_QUEUED);
return ret; return ret;
} }
...@@ -274,7 +273,7 @@ static void vimc_capture_stop_streaming(struct vb2_queue *vq) ...@@ -274,7 +273,7 @@ static void vimc_capture_stop_streaming(struct vb2_queue *vq)
vimc_streamer_s_stream(&vcapture->stream, &vcapture->ved, 0); vimc_streamer_s_stream(&vcapture->stream, &vcapture->ved, 0);
/* Stop the media pipeline */ /* Stop the media pipeline */
media_pipeline_stop(&vcapture->vdev.entity); video_device_pipeline_stop(&vcapture->vdev);
/* Release all active buffers */ /* Release all active buffers */
vimc_capture_return_all_buffers(vcapture, VB2_BUF_STATE_ERROR); vimc_capture_return_all_buffers(vcapture, VB2_BUF_STATE_ERROR);
......
...@@ -1360,7 +1360,7 @@ static int imx7_csi_video_start_streaming(struct vb2_queue *vq, ...@@ -1360,7 +1360,7 @@ static int imx7_csi_video_start_streaming(struct vb2_queue *vq,
mutex_lock(&csi->mdev.graph_mutex); mutex_lock(&csi->mdev.graph_mutex);
ret = __media_pipeline_start(&csi->sd.entity, &csi->pipe); ret = __video_device_pipeline_start(csi->vdev, &csi->pipe);
if (ret) if (ret)
goto err_unlock; goto err_unlock;
...@@ -1373,7 +1373,7 @@ static int imx7_csi_video_start_streaming(struct vb2_queue *vq, ...@@ -1373,7 +1373,7 @@ static int imx7_csi_video_start_streaming(struct vb2_queue *vq,
return 0; return 0;
err_stop: err_stop:
__media_pipeline_stop(&csi->sd.entity); __video_device_pipeline_stop(csi->vdev);
err_unlock: err_unlock:
mutex_unlock(&csi->mdev.graph_mutex); mutex_unlock(&csi->mdev.graph_mutex);
dev_err(csi->dev, "pipeline start failed with %d\n", ret); dev_err(csi->dev, "pipeline start failed with %d\n", ret);
...@@ -1396,7 +1396,7 @@ static void imx7_csi_video_stop_streaming(struct vb2_queue *vq) ...@@ -1396,7 +1396,7 @@ static void imx7_csi_video_stop_streaming(struct vb2_queue *vq)
mutex_lock(&csi->mdev.graph_mutex); mutex_lock(&csi->mdev.graph_mutex);
v4l2_subdev_call(&csi->sd, video, s_stream, 0); v4l2_subdev_call(&csi->sd, video, s_stream, 0);
__media_pipeline_stop(&csi->sd.entity); __video_device_pipeline_stop(csi->vdev);
mutex_unlock(&csi->mdev.graph_mutex); mutex_unlock(&csi->mdev.graph_mutex);
/* release all active buffers */ /* release all active buffers */
......
...@@ -483,7 +483,7 @@ static int imgu_vb2_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -483,7 +483,7 @@ static int imgu_vb2_start_streaming(struct vb2_queue *vq, unsigned int count)
pipe = node->pipe; pipe = node->pipe;
imgu_pipe = &imgu->imgu_pipe[pipe]; imgu_pipe = &imgu->imgu_pipe[pipe];
atomic_set(&node->sequence, 0); atomic_set(&node->sequence, 0);
r = media_pipeline_start(&node->vdev.entity, &imgu_pipe->pipeline); r = video_device_pipeline_start(&node->vdev, &imgu_pipe->pipeline);
if (r < 0) if (r < 0)
goto fail_return_bufs; goto fail_return_bufs;
...@@ -508,7 +508,7 @@ static int imgu_vb2_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -508,7 +508,7 @@ static int imgu_vb2_start_streaming(struct vb2_queue *vq, unsigned int count)
return 0; return 0;
fail_stop_pipeline: fail_stop_pipeline:
media_pipeline_stop(&node->vdev.entity); video_device_pipeline_stop(&node->vdev);
fail_return_bufs: fail_return_bufs:
imgu_return_all_buffers(imgu, node, VB2_BUF_STATE_QUEUED); imgu_return_all_buffers(imgu, node, VB2_BUF_STATE_QUEUED);
...@@ -548,7 +548,7 @@ static void imgu_vb2_stop_streaming(struct vb2_queue *vq) ...@@ -548,7 +548,7 @@ static void imgu_vb2_stop_streaming(struct vb2_queue *vq)
imgu_return_all_buffers(imgu, node, VB2_BUF_STATE_ERROR); imgu_return_all_buffers(imgu, node, VB2_BUF_STATE_ERROR);
mutex_unlock(&imgu->streaming_lock); mutex_unlock(&imgu->streaming_lock);
media_pipeline_stop(&node->vdev.entity); video_device_pipeline_stop(&node->vdev);
} }
/******************** v4l2_ioctl_ops ********************/ /******************** v4l2_ioctl_ops ********************/
......
...@@ -886,7 +886,7 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type) ...@@ -886,7 +886,7 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
if (video->iss->pdata->set_constraints) if (video->iss->pdata->set_constraints)
video->iss->pdata->set_constraints(video->iss, true); video->iss->pdata->set_constraints(video->iss, true);
ret = media_pipeline_start(entity, &pipe->pipe); ret = video_device_pipeline_start(&video->video, &pipe->pipe);
if (ret < 0) if (ret < 0)
goto err_media_pipeline_start; goto err_media_pipeline_start;
...@@ -977,7 +977,7 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type) ...@@ -977,7 +977,7 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
err_omap4iss_set_stream: err_omap4iss_set_stream:
vb2_streamoff(&vfh->queue, type); vb2_streamoff(&vfh->queue, type);
err_iss_video_check_format: err_iss_video_check_format:
media_pipeline_stop(&video->video.entity); video_device_pipeline_stop(&video->video);
err_media_pipeline_start: err_media_pipeline_start:
if (video->iss->pdata->set_constraints) if (video->iss->pdata->set_constraints)
video->iss->pdata->set_constraints(video->iss, false); video->iss->pdata->set_constraints(video->iss, false);
...@@ -1031,7 +1031,7 @@ iss_video_streamoff(struct file *file, void *fh, enum v4l2_buf_type type) ...@@ -1031,7 +1031,7 @@ iss_video_streamoff(struct file *file, void *fh, enum v4l2_buf_type type)
if (video->iss->pdata->set_constraints) if (video->iss->pdata->set_constraints)
video->iss->pdata->set_constraints(video->iss, false); video->iss->pdata->set_constraints(video->iss, false);
media_pipeline_stop(&video->video.entity); video_device_pipeline_stop(&video->video);
done: done:
mutex_unlock(&video->stream_lock); mutex_unlock(&video->stream_lock);
......
...@@ -547,7 +547,7 @@ static int tegra210_vi_start_streaming(struct vb2_queue *vq, u32 count) ...@@ -547,7 +547,7 @@ static int tegra210_vi_start_streaming(struct vb2_queue *vq, u32 count)
VI_INCR_SYNCPT_NO_STALL); VI_INCR_SYNCPT_NO_STALL);
/* start the pipeline */ /* start the pipeline */
ret = media_pipeline_start(&chan->video.entity, pipe); ret = video_device_pipeline_start(&chan->video, pipe);
if (ret < 0) if (ret < 0)
goto error_pipeline_start; goto error_pipeline_start;
...@@ -595,7 +595,7 @@ static int tegra210_vi_start_streaming(struct vb2_queue *vq, u32 count) ...@@ -595,7 +595,7 @@ static int tegra210_vi_start_streaming(struct vb2_queue *vq, u32 count)
error_kthread_start: error_kthread_start:
tegra_channel_set_stream(chan, false); tegra_channel_set_stream(chan, false);
error_set_stream: error_set_stream:
media_pipeline_stop(&chan->video.entity); video_device_pipeline_stop(&chan->video);
error_pipeline_start: error_pipeline_start:
tegra_channel_release_buffers(chan, VB2_BUF_STATE_QUEUED); tegra_channel_release_buffers(chan, VB2_BUF_STATE_QUEUED);
return ret; return ret;
...@@ -617,7 +617,7 @@ static void tegra210_vi_stop_streaming(struct vb2_queue *vq) ...@@ -617,7 +617,7 @@ static void tegra210_vi_stop_streaming(struct vb2_queue *vq)
tegra_channel_release_buffers(chan, VB2_BUF_STATE_ERROR); tegra_channel_release_buffers(chan, VB2_BUF_STATE_ERROR);
tegra_channel_set_stream(chan, false); tegra_channel_set_stream(chan, false);
media_pipeline_stop(&chan->video.entity); video_device_pipeline_stop(&chan->video);
} }
/* /*
......
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