From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 2/3] omap3isp: Move starting the sensor from streamon IOCTL handler to VB2 QOP
Date: Mon, 09 Nov 2015 21:17:57 +0200 [thread overview]
Message-ID: <1465641.kaD0S8lILY@avalon> (raw)
In-Reply-To: <1411077469-29178-3-git-send-email-sakari.ailus@iki.fi>
Hi Sakari,
Thank you for the patch.
On Friday 19 September 2014 00:57:48 Sakari Ailus wrote:
> Move the starting of the sensor from the VIDIOC_STREAMON handler to the
> videobuf2 queue op start_streaming. This avoids failing starting the stream
> after vb2_streamon() has already finished.
>
> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
and applied to my tree.
> ---
> drivers/media/platform/omap3isp/ispvideo.c | 49 +++++++++++++++---------
> 1 file changed, 30 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/media/platform/omap3isp/ispvideo.c
> b/drivers/media/platform/omap3isp/ispvideo.c index bc38c88..b233c8e 100644
> --- a/drivers/media/platform/omap3isp/ispvideo.c
> +++ b/drivers/media/platform/omap3isp/ispvideo.c
> @@ -425,10 +425,40 @@ static void isp_video_buffer_queue(struct vb2_buffer
> *buf) }
> }
>
> +static int isp_video_start_streaming(struct vb2_queue *queue,
> + unsigned int count)
> +{
> + struct isp_video_fh *vfh = vb2_get_drv_priv(queue);
> + struct isp_video *video = vfh->video;
> + struct isp_pipeline *pipe = to_isp_pipeline(&video->video.entity);
> + unsigned long flags;
> + int ret;
> +
> + /* In sensor-to-memory mode, the stream can be started synchronously
> + * to the stream on command. In memory-to-memory mode, it will be
> + * started when buffers are queued on both the input and output.
> + */
> + if (pipe->input)
> + return 0;
> +
> + ret = omap3isp_pipeline_set_stream(pipe,
> + ISP_PIPELINE_STREAM_CONTINUOUS);
> + if (ret < 0)
> + return ret;
> +
> + spin_lock_irqsave(&video->irqlock, flags);
> + if (list_empty(&video->dmaqueue))
> + video->dmaqueue_flags |= ISP_VIDEO_DMAQUEUE_UNDERRUN;
> + spin_unlock_irqrestore(&video->irqlock, flags);
> +
> + return 0;
> +}
> +
> static const struct vb2_ops isp_video_queue_ops = {
> .queue_setup = isp_video_queue_setup,
> .buf_prepare = isp_video_buffer_prepare,
> .buf_queue = isp_video_buffer_queue,
> + .start_streaming = isp_video_start_streaming,
> };
>
> /*
> @@ -1077,28 +1107,9 @@ isp_video_streamon(struct file *file, void *fh, enum
> v4l2_buf_type type) if (ret < 0)
> goto err_check_format;
>
> - /* In sensor-to-memory mode, the stream can be started synchronously
> - * to the stream on command. In memory-to-memory mode, it will be
> - * started when buffers are queued on both the input and output.
> - */
> - if (pipe->input == NULL) {
> - ret = omap3isp_pipeline_set_stream(pipe,
> - ISP_PIPELINE_STREAM_CONTINUOUS);
> - if (ret < 0)
> - goto err_set_stream;
> - spin_lock_irqsave(&video->irqlock, flags);
> - if (list_empty(&video->dmaqueue))
> - video->dmaqueue_flags |= ISP_VIDEO_DMAQUEUE_UNDERRUN;
> - spin_unlock_irqrestore(&video->irqlock, flags);
> - }
> -
> mutex_unlock(&video->stream_lock);
> return 0;
>
> -err_set_stream:
> - mutex_lock(&video->queue_lock);
> - vb2_streamoff(&vfh->queue, type);
> - mutex_unlock(&video->queue_lock);
> err_check_format:
> media_entity_pipeline_stop(&video->video.entity);
> err_pipeline_start:
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2015-11-09 19:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-18 21:57 [PATCH 0/3] vb2 and omap3isp driver fixes Sakari Ailus
2014-09-18 21:57 ` [PATCH 1/3] vb2: Buffers returned to videobuf2 from start_streaming in QUEUED state Sakari Ailus
2014-09-19 7:59 ` Sakari Ailus
2014-09-19 8:13 ` Hans Verkuil
2014-09-19 8:21 ` Sakari Ailus
2014-09-18 21:57 ` [PATCH 2/3] omap3isp: Move starting the sensor from streamon IOCTL handler to VB2 QOP Sakari Ailus
2015-11-09 19:17 ` Laurent Pinchart [this message]
2014-09-18 21:57 ` [PATCH 3/3] omap3isp: Return buffers back to videobuf2 if pipeline streamon fails Sakari Ailus
2015-11-09 19:38 ` Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1465641.kaD0S8lILY@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).