All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] media: ipu3: Sequence number fix and improvements
@ 2022-03-18 12:18 Umang Jain
  2022-03-18 12:18 ` [PATCH 1/2] media: staging/intel-ipu3: Reset imgu_video_device sequence Umang Jain
  2022-03-18 12:18 ` [PATCH 2/2] media: staging/intel-ipu3: Cleanup dummy buffers via helper Umang Jain
  0 siblings, 2 replies; 5+ messages in thread
From: Umang Jain @ 2022-03-18 12:18 UTC (permalink / raw)
  To: linux-media; +Cc: bingbu.cao, sakari.ailus, libcamera-devel, Umang Jain

The patch (1/2) fixes the issue where sequence number of buffers keep
on incrementing during consecutive stream on/off cycles. The sequence
number should be reset to 0, on every stream (re)start.

Patch 2/2 is a just a drive-by patch while exploring ipu3-imgu driver
codebase.

Umang Jain (2):
  media: staging/intel-ipu3: Reset imgu_video_device sequence
  media: staging/intel-ipu3: Cleanup dummy buffers via helper

 drivers/staging/media/ipu3/ipu3-v4l2.c |  1 +
 drivers/staging/media/ipu3/ipu3.c      | 25 +++++++++++--------------
 2 files changed, 12 insertions(+), 14 deletions(-)

-- 
2.31.1


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

* [PATCH 1/2] media: staging/intel-ipu3: Reset imgu_video_device sequence
  2022-03-18 12:18 [PATCH 0/2] media: ipu3: Sequence number fix and improvements Umang Jain
@ 2022-03-18 12:18 ` Umang Jain
  2022-03-22 23:22   ` [libcamera-devel] " Laurent Pinchart
  2022-03-18 12:18 ` [PATCH 2/2] media: staging/intel-ipu3: Cleanup dummy buffers via helper Umang Jain
  1 sibling, 1 reply; 5+ messages in thread
From: Umang Jain @ 2022-03-18 12:18 UTC (permalink / raw)
  To: linux-media; +Cc: bingbu.cao, sakari.ailus, libcamera-devel, Umang Jain

Reset the sequence number of imgu_video_device on stream start.
Failing to do so results in sequence number getting incremented
for consecutive stream on/off cycles.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 drivers/staging/media/ipu3/ipu3-v4l2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c
index 0473457b4e64..d1c539cefba8 100644
--- a/drivers/staging/media/ipu3/ipu3-v4l2.c
+++ b/drivers/staging/media/ipu3/ipu3-v4l2.c
@@ -485,6 +485,7 @@ static int imgu_vb2_start_streaming(struct vb2_queue *vq, unsigned int count)
 
 	pipe = node->pipe;
 	imgu_pipe = &imgu->imgu_pipe[pipe];
+	atomic_set(&node->sequence, 0);
 	r = media_pipeline_start(&node->vdev.entity, &imgu_pipe->pipeline);
 	if (r < 0)
 		goto fail_return_bufs;
-- 
2.31.1


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

* [PATCH 2/2] media: staging/intel-ipu3: Cleanup dummy buffers via helper
  2022-03-18 12:18 [PATCH 0/2] media: ipu3: Sequence number fix and improvements Umang Jain
  2022-03-18 12:18 ` [PATCH 1/2] media: staging/intel-ipu3: Reset imgu_video_device sequence Umang Jain
@ 2022-03-18 12:18 ` Umang Jain
  2022-03-22 23:23   ` [libcamera-devel] " Laurent Pinchart
  1 sibling, 1 reply; 5+ messages in thread
From: Umang Jain @ 2022-03-18 12:18 UTC (permalink / raw)
  To: linux-media; +Cc: bingbu.cao, sakari.ailus, libcamera-devel, Umang Jain

Use an existing helper imgu_video_nodes_exit() on imgu-video-node
initialization failure path to cleanup dummy buffers.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 drivers/staging/media/ipu3/ipu3.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/media/ipu3/ipu3.c b/drivers/staging/media/ipu3/ipu3.c
index 8e1e9e46e604..0c453b37f8c4 100644
--- a/drivers/staging/media/ipu3/ipu3.c
+++ b/drivers/staging/media/ipu3/ipu3.c
@@ -440,6 +440,16 @@ int imgu_s_stream(struct imgu_device *imgu, int enable)
 	return r;
 }
 
+static void imgu_video_nodes_exit(struct imgu_device *imgu)
+{
+	int i;
+
+	for (i = 0; i < IMGU_MAX_PIPE_NUM; i++)
+		imgu_dummybufs_cleanup(imgu, i);
+
+	imgu_v4l2_unregister(imgu);
+}
+
 static int imgu_video_nodes_init(struct imgu_device *imgu)
 {
 	struct v4l2_pix_format_mplane *fmts[IPU3_CSS_QUEUES] = { NULL };
@@ -489,24 +499,11 @@ static int imgu_video_nodes_init(struct imgu_device *imgu)
 	return 0;
 
 out_cleanup:
-	for (j = 0; j < IMGU_MAX_PIPE_NUM; j++)
-		imgu_dummybufs_cleanup(imgu, j);
-
-	imgu_v4l2_unregister(imgu);
+	imgu_video_nodes_exit(imgu);
 
 	return r;
 }
 
-static void imgu_video_nodes_exit(struct imgu_device *imgu)
-{
-	int i;
-
-	for (i = 0; i < IMGU_MAX_PIPE_NUM; i++)
-		imgu_dummybufs_cleanup(imgu, i);
-
-	imgu_v4l2_unregister(imgu);
-}
-
 /**************** PCI interface ****************/
 
 static irqreturn_t imgu_isr_threaded(int irq, void *imgu_ptr)
-- 
2.31.1


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

* Re: [libcamera-devel] [PATCH 1/2] media: staging/intel-ipu3: Reset imgu_video_device sequence
  2022-03-18 12:18 ` [PATCH 1/2] media: staging/intel-ipu3: Reset imgu_video_device sequence Umang Jain
@ 2022-03-22 23:22   ` Laurent Pinchart
  0 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2022-03-22 23:22 UTC (permalink / raw)
  To: Umang Jain; +Cc: linux-media, bingbu.cao, libcamera-devel, sakari.ailus

Hi Umang,

Thank you for the patch.

On Fri, Mar 18, 2022 at 05:48:25PM +0530, Umang Jain via libcamera-devel wrote:
> Reset the sequence number of imgu_video_device on stream start.
> Failing to do so results in sequence number getting incremented
> for consecutive stream on/off cycles.
> 
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>

Looks good to me.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/staging/media/ipu3/ipu3-v4l2.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c
> index 0473457b4e64..d1c539cefba8 100644
> --- a/drivers/staging/media/ipu3/ipu3-v4l2.c
> +++ b/drivers/staging/media/ipu3/ipu3-v4l2.c
> @@ -485,6 +485,7 @@ static int imgu_vb2_start_streaming(struct vb2_queue *vq, unsigned int count)
>  
>  	pipe = node->pipe;
>  	imgu_pipe = &imgu->imgu_pipe[pipe];
> +	atomic_set(&node->sequence, 0);
>  	r = media_pipeline_start(&node->vdev.entity, &imgu_pipe->pipeline);
>  	if (r < 0)
>  		goto fail_return_bufs;

-- 
Regards,

Laurent Pinchart

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

* Re: [libcamera-devel] [PATCH 2/2] media: staging/intel-ipu3: Cleanup dummy buffers via helper
  2022-03-18 12:18 ` [PATCH 2/2] media: staging/intel-ipu3: Cleanup dummy buffers via helper Umang Jain
@ 2022-03-22 23:23   ` Laurent Pinchart
  0 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2022-03-22 23:23 UTC (permalink / raw)
  To: Umang Jain; +Cc: linux-media, bingbu.cao, libcamera-devel, sakari.ailus

Hi Umang,

Thank you for the patch.

On Fri, Mar 18, 2022 at 05:48:26PM +0530, Umang Jain via libcamera-devel wrote:
> Use an existing helper imgu_video_nodes_exit() on imgu-video-node
> initialization failure path to cleanup dummy buffers.
> 
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/staging/media/ipu3/ipu3.c | 25 +++++++++++--------------
>  1 file changed, 11 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/staging/media/ipu3/ipu3.c b/drivers/staging/media/ipu3/ipu3.c
> index 8e1e9e46e604..0c453b37f8c4 100644
> --- a/drivers/staging/media/ipu3/ipu3.c
> +++ b/drivers/staging/media/ipu3/ipu3.c
> @@ -440,6 +440,16 @@ int imgu_s_stream(struct imgu_device *imgu, int enable)
>  	return r;
>  }
>  
> +static void imgu_video_nodes_exit(struct imgu_device *imgu)
> +{
> +	int i;
> +
> +	for (i = 0; i < IMGU_MAX_PIPE_NUM; i++)
> +		imgu_dummybufs_cleanup(imgu, i);
> +
> +	imgu_v4l2_unregister(imgu);
> +}
> +
>  static int imgu_video_nodes_init(struct imgu_device *imgu)
>  {
>  	struct v4l2_pix_format_mplane *fmts[IPU3_CSS_QUEUES] = { NULL };
> @@ -489,24 +499,11 @@ static int imgu_video_nodes_init(struct imgu_device *imgu)
>  	return 0;
>  
>  out_cleanup:
> -	for (j = 0; j < IMGU_MAX_PIPE_NUM; j++)
> -		imgu_dummybufs_cleanup(imgu, j);
> -
> -	imgu_v4l2_unregister(imgu);
> +	imgu_video_nodes_exit(imgu);
>  
>  	return r;
>  }
>  
> -static void imgu_video_nodes_exit(struct imgu_device *imgu)
> -{
> -	int i;
> -
> -	for (i = 0; i < IMGU_MAX_PIPE_NUM; i++)
> -		imgu_dummybufs_cleanup(imgu, i);
> -
> -	imgu_v4l2_unregister(imgu);
> -}
> -
>  /**************** PCI interface ****************/
>  
>  static irqreturn_t imgu_isr_threaded(int irq, void *imgu_ptr)

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2022-03-22 23:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-18 12:18 [PATCH 0/2] media: ipu3: Sequence number fix and improvements Umang Jain
2022-03-18 12:18 ` [PATCH 1/2] media: staging/intel-ipu3: Reset imgu_video_device sequence Umang Jain
2022-03-22 23:22   ` [libcamera-devel] " Laurent Pinchart
2022-03-18 12:18 ` [PATCH 2/2] media: staging/intel-ipu3: Cleanup dummy buffers via helper Umang Jain
2022-03-22 23:23   ` [libcamera-devel] " Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.