linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: imx: Remove incorrect check for queue state in start_streaming
@ 2017-11-17 18:23 Ian Jamison
  2017-12-01 12:47 ` Hans Verkuil
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Jamison @ 2017-11-17 18:23 UTC (permalink / raw)
  To: linux-media, Steve Longerbeam; +Cc: Philipp Zabel

It is possible to call STREAMON without the minimum number of
buffers queued. In this case the vb2_queue state will be set to
streaming but the start_streaming vb2_op will not be called.
Later when enough buffers are queued, start_streaming will
be called but vb2_is_streaming will already return true.

Signed-off-by: Ian Jamison <ian.dev@arkver.com>
---
 drivers/staging/media/imx/imx-media-capture.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c
index ddab4c249da2..34b492c2419c 100644
--- a/drivers/staging/media/imx/imx-media-capture.c
+++ b/drivers/staging/media/imx/imx-media-capture.c
@@ -449,9 +449,6 @@ static int capture_start_streaming(struct vb2_queue *vq, unsigned int count)
 	unsigned long flags;
 	int ret;
 
-	if (vb2_is_streaming(vq))
-		return 0;
-
 	ret = imx_media_pipeline_set_stream(priv->md, &priv->src_sd->entity,
 					    true);
 	if (ret) {
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: imx: Remove incorrect check for queue state in start_streaming
  2017-11-17 18:23 [PATCH] media: imx: Remove incorrect check for queue state in start_streaming Ian Jamison
@ 2017-12-01 12:47 ` Hans Verkuil
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Verkuil @ 2017-12-01 12:47 UTC (permalink / raw)
  To: Ian Jamison, linux-media, Steve Longerbeam; +Cc: Philipp Zabel

On 11/17/17 19:23, Ian Jamison wrote:
> It is possible to call STREAMON without the minimum number of
> buffers queued. In this case the vb2_queue state will be set to
> streaming but the start_streaming vb2_op will not be called.
> Later when enough buffers are queued, start_streaming will
> be called but vb2_is_streaming will already return true.
> 
> Signed-off-by: Ian Jamison <ian.dev@arkver.com>
> ---
>  drivers/staging/media/imx/imx-media-capture.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c
> index ddab4c249da2..34b492c2419c 100644
> --- a/drivers/staging/media/imx/imx-media-capture.c
> +++ b/drivers/staging/media/imx/imx-media-capture.c
> @@ -449,9 +449,6 @@ static int capture_start_streaming(struct vb2_queue *vq, unsigned int count)
>  	unsigned long flags;
>  	int ret;
>  
> -	if (vb2_is_streaming(vq))
> -		return 0;
> -
>  	ret = imx_media_pipeline_set_stream(priv->md, &priv->src_sd->entity,
>  					    true);
>  	if (ret) {
> 

Can you also remove this from capture_stop_streaming:

        if (!vb2_is_streaming(vq))
                return;

Both checks are wrong and pointless. The vb2 core will do all the right checks
and this shouldn't be done again (and wrongly) in the driver.

Regards,

	Hans

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-01 12:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-17 18:23 [PATCH] media: imx: Remove incorrect check for queue state in start_streaming Ian Jamison
2017-12-01 12:47 ` Hans Verkuil

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).