LinuxTV Patchwork [5/8] media: vimc: stream: cleanup frame field from struct vimc_stream

login
register
mail settings
Submitter Helen Fornazier
Date March 6, 2019, 10:42 p.m.
Message ID <20190306224244.21070-6-helen.koike@collabora.com>
Download mbox | patch
Permalink /patch/54923/
State Accepted
Delegated to: Hans Verkuil
Headers show

Comments

Helen Fornazier - March 6, 2019, 10:42 p.m.
There is no need to have the frame field in the vimc_stream struct.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
---

 drivers/media/platform/vimc/vimc-streamer.c | 10 ++++------
 drivers/media/platform/vimc/vimc-streamer.h |  1 -
 2 files changed, 4 insertions(+), 7 deletions(-)
André Almeida - March 7, 2019, 8:19 p.m.
Hello,

I've tested the stream (with the default media bus format and using an 
alternative one) using a custom user space application and tested all 
capture entities using qv4l2 -d /dev/videoX (where X is each of the 
capture entities). Also, I have checked v4l2-compliance -d /dev/videoX 
and with v4l2-compliance --streaming=5 -d /dev/videoX and no regressions 
where found.

On 3/6/19 7:42 PM, Helen Koike wrote:
> There is no need to have the frame field in the vimc_stream struct.
>
> Signed-off-by: Helen Koike <helen.koike@collabora.com>
Tested-by: André Almeida <andre.almeida@collabora.com>
> ---
>
>   drivers/media/platform/vimc/vimc-streamer.c | 10 ++++------
>   drivers/media/platform/vimc/vimc-streamer.h |  1 -
>   2 files changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/media/platform/vimc/vimc-streamer.c b/drivers/media/platform/vimc/vimc-streamer.c
> index 392754c18046..b7c1fdef5f0d 100644
> --- a/drivers/media/platform/vimc/vimc-streamer.c
> +++ b/drivers/media/platform/vimc/vimc-streamer.c
> @@ -117,6 +117,7 @@ static int vimc_streamer_pipeline_init(struct vimc_stream *stream,
>   static int vimc_streamer_thread(void *data)
>   {
>   	struct vimc_stream *stream = data;
> +	u8 *frame = NULL;
>   	int i;
>   
>   	set_freezable();
> @@ -127,12 +128,9 @@ static int vimc_streamer_thread(void *data)
>   			break;
>   
>   		for (i = stream->pipe_size - 1; i >= 0; i--) {
> -			stream->frame = stream->ved_pipeline[i]->process_frame(
> -					stream->ved_pipeline[i],
> -					stream->frame);
> -			if (!stream->frame)
> -				break;
> -			if (IS_ERR(stream->frame))
> +			frame = stream->ved_pipeline[i]->process_frame(
> +					stream->ved_pipeline[i], frame);
> +			if (!frame || IS_ERR(frame))
>   				break;
>   		}
>   		//wait for 60hz
> diff --git a/drivers/media/platform/vimc/vimc-streamer.h b/drivers/media/platform/vimc/vimc-streamer.h
> index 752af2e2d5a2..dc1d0be431cb 100644
> --- a/drivers/media/platform/vimc/vimc-streamer.h
> +++ b/drivers/media/platform/vimc/vimc-streamer.h
> @@ -19,7 +19,6 @@ struct vimc_stream {
>   	struct media_pipeline pipe;
>   	struct vimc_ent_device *ved_pipeline[VIMC_STREAMER_PIPELINE_MAX_SIZE];
>   	unsigned int pipe_size;
> -	u8 *frame;
>   	struct task_struct *kthread;
>   };
>

Patch

diff --git a/drivers/media/platform/vimc/vimc-streamer.c b/drivers/media/platform/vimc/vimc-streamer.c
index 392754c18046..b7c1fdef5f0d 100644
--- a/drivers/media/platform/vimc/vimc-streamer.c
+++ b/drivers/media/platform/vimc/vimc-streamer.c
@@ -117,6 +117,7 @@  static int vimc_streamer_pipeline_init(struct vimc_stream *stream,
 static int vimc_streamer_thread(void *data)
 {
 	struct vimc_stream *stream = data;
+	u8 *frame = NULL;
 	int i;
 
 	set_freezable();
@@ -127,12 +128,9 @@  static int vimc_streamer_thread(void *data)
 			break;
 
 		for (i = stream->pipe_size - 1; i >= 0; i--) {
-			stream->frame = stream->ved_pipeline[i]->process_frame(
-					stream->ved_pipeline[i],
-					stream->frame);
-			if (!stream->frame)
-				break;
-			if (IS_ERR(stream->frame))
+			frame = stream->ved_pipeline[i]->process_frame(
+					stream->ved_pipeline[i], frame);
+			if (!frame || IS_ERR(frame))
 				break;
 		}
 		//wait for 60hz
diff --git a/drivers/media/platform/vimc/vimc-streamer.h b/drivers/media/platform/vimc/vimc-streamer.h
index 752af2e2d5a2..dc1d0be431cb 100644
--- a/drivers/media/platform/vimc/vimc-streamer.h
+++ b/drivers/media/platform/vimc/vimc-streamer.h
@@ -19,7 +19,6 @@  struct vimc_stream {
 	struct media_pipeline pipe;
 	struct vimc_ent_device *ved_pipeline[VIMC_STREAMER_PIPELINE_MAX_SIZE];
 	unsigned int pipe_size;
-	u8 *frame;
 	struct task_struct *kthread;
 };
 

Privacy Policy