media: atomisp: Use new atomisp_flush_video_pipe() helper in atomisp_streamoff()
Use the new atomisp_flush_video_pipe() helper instead of open-coding it. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
Родитель
b7465077f7
Коммит
ce8e263283
|
@ -1732,11 +1732,6 @@ int atomisp_streamoff(struct file *file, void *fh, enum v4l2_buf_type type)
|
||||||
struct pci_dev *pdev = to_pci_dev(isp->dev);
|
struct pci_dev *pdev = to_pci_dev(isp->dev);
|
||||||
struct atomisp_video_pipe *pipe = atomisp_to_video_pipe(vdev);
|
struct atomisp_video_pipe *pipe = atomisp_to_video_pipe(vdev);
|
||||||
struct atomisp_sub_device *asd = pipe->asd;
|
struct atomisp_sub_device *asd = pipe->asd;
|
||||||
struct atomisp_video_pipe *capture_pipe = NULL;
|
|
||||||
struct atomisp_video_pipe *vf_pipe = NULL;
|
|
||||||
struct atomisp_video_pipe *preview_pipe = NULL;
|
|
||||||
struct atomisp_video_pipe *video_pipe = NULL;
|
|
||||||
struct videobuf_buffer *vb, *_vb;
|
|
||||||
enum ia_css_pipe_id css_pipe_id;
|
enum ia_css_pipe_id css_pipe_id;
|
||||||
int ret;
|
int ret;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
@ -1817,43 +1812,12 @@ int atomisp_streamoff(struct file *file, void *fh, enum v4l2_buf_type type)
|
||||||
css_pipe_id = atomisp_get_css_pipe_id(asd);
|
css_pipe_id = atomisp_get_css_pipe_id(asd);
|
||||||
atomisp_css_stop(asd, css_pipe_id, false);
|
atomisp_css_stop(asd, css_pipe_id, false);
|
||||||
|
|
||||||
/* cancel work queue*/
|
atomisp_flush_video_pipe(pipe, true);
|
||||||
if (asd->video_out_capture.users) {
|
|
||||||
capture_pipe = &asd->video_out_capture;
|
|
||||||
wake_up_interruptible(&capture_pipe->capq.wait);
|
|
||||||
}
|
|
||||||
if (asd->video_out_vf.users) {
|
|
||||||
vf_pipe = &asd->video_out_vf;
|
|
||||||
wake_up_interruptible(&vf_pipe->capq.wait);
|
|
||||||
}
|
|
||||||
if (asd->video_out_preview.users) {
|
|
||||||
preview_pipe = &asd->video_out_preview;
|
|
||||||
wake_up_interruptible(&preview_pipe->capq.wait);
|
|
||||||
}
|
|
||||||
if (asd->video_out_video_capture.users) {
|
|
||||||
video_pipe = &asd->video_out_video_capture;
|
|
||||||
wake_up_interruptible(&video_pipe->capq.wait);
|
|
||||||
}
|
|
||||||
ret = videobuf_streamoff(&pipe->capq);
|
ret = videobuf_streamoff(&pipe->capq);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* cleanup css here */
|
|
||||||
/* no need for this, as ISP will be reset anyway */
|
|
||||||
/*atomisp_flush_bufs_in_css(isp);*/
|
|
||||||
|
|
||||||
spin_lock_irqsave(&pipe->irq_lock, flags);
|
|
||||||
list_for_each_entry_safe(vb, _vb, &pipe->activeq, queue) {
|
|
||||||
vb->state = VIDEOBUF_PREPARED;
|
|
||||||
list_del(&vb->queue);
|
|
||||||
}
|
|
||||||
list_for_each_entry_safe(vb, _vb, &pipe->buffers_waiting_for_param, queue) {
|
|
||||||
vb->state = VIDEOBUF_PREPARED;
|
|
||||||
list_del(&vb->queue);
|
|
||||||
pipe->frame_request_config_id[vb->i] = 0;
|
|
||||||
}
|
|
||||||
spin_unlock_irqrestore(&pipe->irq_lock, flags);
|
|
||||||
|
|
||||||
atomisp_subdev_cleanup_pending_events(asd);
|
atomisp_subdev_cleanup_pending_events(asd);
|
||||||
stopsensor:
|
stopsensor:
|
||||||
if (atomisp_subdev_streaming_count(asd) + 1
|
if (atomisp_subdev_streaming_count(asd) + 1
|
||||||
|
|
Загрузка…
Ссылка в новой задаче