All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: vsp1: Simplify DRM UIF handling
@ 2021-06-18 19:09 Kieran Bingham
  2021-06-18 19:33 ` Laurent Pinchart
  2021-06-19  7:25 ` Biju Das
  0 siblings, 2 replies; 5+ messages in thread
From: Kieran Bingham @ 2021-06-18 19:09 UTC (permalink / raw)
  To: Laurent Pinchart, Kieran Bingham, linux-renesas-soc, linux-media
  Cc: Kieran Bingham

From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

In commit 6732f3139380 ("media: v4l: vsp1: Fix uif null pointer access")
the handling of the UIF was over complicated, and the patch applied
before review.

Simplify it to keep the conditionals small.

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
---

Another one that I had lying around in my tree for too long ....

 drivers/media/platform/vsp1/vsp1_drm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c
index 06f74d410973..0c2507dc03d6 100644
--- a/drivers/media/platform/vsp1/vsp1_drm.c
+++ b/drivers/media/platform/vsp1/vsp1_drm.c
@@ -455,6 +455,10 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,
 		dev_err(vsp1->dev, "%s: failed to setup UIF after %s\n",
 			__func__, BRX_NAME(pipe->brx));
 
+	/* If the DRM pipe does not have a UIF there is nothing we can update. */
+	if (!drm_pipe->uif)
+		return 0;
+
 	/*
 	 * If the UIF is not in use schedule it for removal by setting its pipe
 	 * pointer to NULL, vsp1_du_pipeline_configure() will remove it from the
@@ -462,9 +466,9 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,
 	 * make sure it is present in the pipeline's list of entities if it
 	 * wasn't already.
 	 */
-	if (drm_pipe->uif && !use_uif) {
+	if (!use_uif) {
 		drm_pipe->uif->pipe = NULL;
-	} else if (drm_pipe->uif && !drm_pipe->uif->pipe) {
+	} else if (!drm_pipe->uif->pipe) {
 		drm_pipe->uif->pipe = pipe;
 		list_add_tail(&drm_pipe->uif->list_pipe, &pipe->entities);
 	}
-- 
2.30.2


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

* Re: [PATCH] media: vsp1: Simplify DRM UIF handling
  2021-06-18 19:09 [PATCH] media: vsp1: Simplify DRM UIF handling Kieran Bingham
@ 2021-06-18 19:33 ` Laurent Pinchart
  2021-09-01 22:07   ` Kieran Bingham
  2021-06-19  7:25 ` Biju Das
  1 sibling, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2021-06-18 19:33 UTC (permalink / raw)
  To: Kieran Bingham; +Cc: linux-renesas-soc, linux-media, Kieran Bingham

Hi Kieran,

Thank you for the patch.

On Fri, Jun 18, 2021 at 08:09:05PM +0100, Kieran Bingham wrote:
> From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> 
> In commit 6732f3139380 ("media: v4l: vsp1: Fix uif null pointer access")
> the handling of the UIF was over complicated, and the patch applied
> before review.
> 
> Simplify it to keep the conditionals small.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> ---
> 
> Another one that I had lying around in my tree for too long ....

It seems to have survived bitrot quite well.

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

>  drivers/media/platform/vsp1/vsp1_drm.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c
> index 06f74d410973..0c2507dc03d6 100644
> --- a/drivers/media/platform/vsp1/vsp1_drm.c
> +++ b/drivers/media/platform/vsp1/vsp1_drm.c
> @@ -455,6 +455,10 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,
>  		dev_err(vsp1->dev, "%s: failed to setup UIF after %s\n",
>  			__func__, BRX_NAME(pipe->brx));
>  
> +	/* If the DRM pipe does not have a UIF there is nothing we can update. */
> +	if (!drm_pipe->uif)
> +		return 0;
> +
>  	/*
>  	 * If the UIF is not in use schedule it for removal by setting its pipe
>  	 * pointer to NULL, vsp1_du_pipeline_configure() will remove it from the
> @@ -462,9 +466,9 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,
>  	 * make sure it is present in the pipeline's list of entities if it
>  	 * wasn't already.
>  	 */
> -	if (drm_pipe->uif && !use_uif) {
> +	if (!use_uif) {
>  		drm_pipe->uif->pipe = NULL;
> -	} else if (drm_pipe->uif && !drm_pipe->uif->pipe) {
> +	} else if (!drm_pipe->uif->pipe) {
>  		drm_pipe->uif->pipe = pipe;
>  		list_add_tail(&drm_pipe->uif->list_pipe, &pipe->entities);
>  	}

-- 
Regards,

Laurent Pinchart

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

* RE: [PATCH] media: vsp1: Simplify DRM UIF handling
  2021-06-18 19:09 [PATCH] media: vsp1: Simplify DRM UIF handling Kieran Bingham
  2021-06-18 19:33 ` Laurent Pinchart
@ 2021-06-19  7:25 ` Biju Das
  1 sibling, 0 replies; 5+ messages in thread
From: Biju Das @ 2021-06-19  7:25 UTC (permalink / raw)
  To: Kieran Bingham, Laurent Pinchart, linux-renesas-soc, linux-media
  Cc: Kieran Bingham

Hi Kieran,

Thanks for the patch.

> Subject: [PATCH] media: vsp1: Simplify DRM UIF handling
> 
> From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> 
> In commit 6732f3139380 ("media: v4l: vsp1: Fix uif null pointer access")
> the handling of the UIF was over complicated, and the patch applied before
> review.
> 
> Simplify it to keep the conditionals small.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

I forgot this. Thanks for taking care this.

Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>

Cheers,
Biju

> ---
> 
> Another one that I had lying around in my tree for too long ....
> 
>  drivers/media/platform/vsp1/vsp1_drm.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/vsp1/vsp1_drm.c
> b/drivers/media/platform/vsp1/vsp1_drm.c
> index 06f74d410973..0c2507dc03d6 100644
> --- a/drivers/media/platform/vsp1/vsp1_drm.c
> +++ b/drivers/media/platform/vsp1/vsp1_drm.c
> @@ -455,6 +455,10 @@ static int vsp1_du_pipeline_setup_inputs(struct
> vsp1_device *vsp1,
>  		dev_err(vsp1->dev, "%s: failed to setup UIF after %s\n",
>  			__func__, BRX_NAME(pipe->brx));
> 
> +	/* If the DRM pipe does not have a UIF there is nothing we can
> update. */
> +	if (!drm_pipe->uif)
> +		return 0;
> +
>  	/*
>  	 * If the UIF is not in use schedule it for removal by setting its
> pipe
>  	 * pointer to NULL, vsp1_du_pipeline_configure() will remove it from
> the @@ -462,9 +466,9 @@ static int vsp1_du_pipeline_setup_inputs(struct
> vsp1_device *vsp1,
>  	 * make sure it is present in the pipeline's list of entities if it
>  	 * wasn't already.
>  	 */
> -	if (drm_pipe->uif && !use_uif) {
> +	if (!use_uif) {
>  		drm_pipe->uif->pipe = NULL;
> -	} else if (drm_pipe->uif && !drm_pipe->uif->pipe) {
> +	} else if (!drm_pipe->uif->pipe) {
>  		drm_pipe->uif->pipe = pipe;
>  		list_add_tail(&drm_pipe->uif->list_pipe, &pipe->entities);
>  	}
> --
> 2.30.2


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

* Re: [PATCH] media: vsp1: Simplify DRM UIF handling
  2021-06-18 19:33 ` Laurent Pinchart
@ 2021-09-01 22:07   ` Kieran Bingham
  2021-09-01 22:08     ` Laurent Pinchart
  0 siblings, 1 reply; 5+ messages in thread
From: Kieran Bingham @ 2021-09-01 22:07 UTC (permalink / raw)
  To: Laurent Pinchart, Kieran Bingham
  Cc: linux-renesas-soc, linux-media, Kieran Bingham

On 18/06/2021 20:33, Laurent Pinchart wrote:
> Hi Kieran,
> 
> Thank you for the patch.
> 
> On Fri, Jun 18, 2021 at 08:09:05PM +0100, Kieran Bingham wrote:
>> From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
>>
>> In commit 6732f3139380 ("media: v4l: vsp1: Fix uif null pointer access")
>> the handling of the UIF was over complicated, and the patch applied
>> before review.
>>
>> Simplify it to keep the conditionals small.
>>
>> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
>> ---
>>
>> Another one that I had lying around in my tree for too long ....
> 
> It seems to have survived bitrot quite well.

This still applies with git am to my tree here ...

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

Thanks, do I need to do anything else to progress this ?

--
Kieran


> 
>>  drivers/media/platform/vsp1/vsp1_drm.c | 8 ++++++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c
>> index 06f74d410973..0c2507dc03d6 100644
>> --- a/drivers/media/platform/vsp1/vsp1_drm.c
>> +++ b/drivers/media/platform/vsp1/vsp1_drm.c
>> @@ -455,6 +455,10 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,
>>  		dev_err(vsp1->dev, "%s: failed to setup UIF after %s\n",
>>  			__func__, BRX_NAME(pipe->brx));
>>  
>> +	/* If the DRM pipe does not have a UIF there is nothing we can update. */
>> +	if (!drm_pipe->uif)
>> +		return 0;
>> +
>>  	/*
>>  	 * If the UIF is not in use schedule it for removal by setting its pipe
>>  	 * pointer to NULL, vsp1_du_pipeline_configure() will remove it from the
>> @@ -462,9 +466,9 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,
>>  	 * make sure it is present in the pipeline's list of entities if it
>>  	 * wasn't already.
>>  	 */
>> -	if (drm_pipe->uif && !use_uif) {
>> +	if (!use_uif) {
>>  		drm_pipe->uif->pipe = NULL;
>> -	} else if (drm_pipe->uif && !drm_pipe->uif->pipe) {
>> +	} else if (!drm_pipe->uif->pipe) {
>>  		drm_pipe->uif->pipe = pipe;
>>  		list_add_tail(&drm_pipe->uif->list_pipe, &pipe->entities);
>>  	}
> 


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

* Re: [PATCH] media: vsp1: Simplify DRM UIF handling
  2021-09-01 22:07   ` Kieran Bingham
@ 2021-09-01 22:08     ` Laurent Pinchart
  0 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2021-09-01 22:08 UTC (permalink / raw)
  To: Kieran Bingham; +Cc: Kieran Bingham, linux-renesas-soc, linux-media

Hi Kieran,

On Wed, Sep 01, 2021 at 11:07:40PM +0100, Kieran Bingham wrote:
> On 18/06/2021 20:33, Laurent Pinchart wrote:
> > On Fri, Jun 18, 2021 at 08:09:05PM +0100, Kieran Bingham wrote:
> >> From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> >>
> >> In commit 6732f3139380 ("media: v4l: vsp1: Fix uif null pointer access")
> >> the handling of the UIF was over complicated, and the patch applied
> >> before review.
> >>
> >> Simplify it to keep the conditionals small.
> >>
> >> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> >> ---
> >>
> >> Another one that I had lying around in my tree for too long ....
> > 
> > It seems to have survived bitrot quite well.
> 
> This still applies with git am to my tree here ...
> 
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Thanks, do I need to do anything else to progress this ?

You can ping me to remind me to send a pull request. Which you just did
:-)

> >>  drivers/media/platform/vsp1/vsp1_drm.c | 8 ++++++--
> >>  1 file changed, 6 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c
> >> index 06f74d410973..0c2507dc03d6 100644
> >> --- a/drivers/media/platform/vsp1/vsp1_drm.c
> >> +++ b/drivers/media/platform/vsp1/vsp1_drm.c
> >> @@ -455,6 +455,10 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,
> >>  		dev_err(vsp1->dev, "%s: failed to setup UIF after %s\n",
> >>  			__func__, BRX_NAME(pipe->brx));
> >>  
> >> +	/* If the DRM pipe does not have a UIF there is nothing we can update. */
> >> +	if (!drm_pipe->uif)
> >> +		return 0;
> >> +
> >>  	/*
> >>  	 * If the UIF is not in use schedule it for removal by setting its pipe
> >>  	 * pointer to NULL, vsp1_du_pipeline_configure() will remove it from the
> >> @@ -462,9 +466,9 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,
> >>  	 * make sure it is present in the pipeline's list of entities if it
> >>  	 * wasn't already.
> >>  	 */
> >> -	if (drm_pipe->uif && !use_uif) {
> >> +	if (!use_uif) {
> >>  		drm_pipe->uif->pipe = NULL;
> >> -	} else if (drm_pipe->uif && !drm_pipe->uif->pipe) {
> >> +	} else if (!drm_pipe->uif->pipe) {
> >>  		drm_pipe->uif->pipe = pipe;
> >>  		list_add_tail(&drm_pipe->uif->list_pipe, &pipe->entities);
> >>  	}

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2021-09-01 22:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18 19:09 [PATCH] media: vsp1: Simplify DRM UIF handling Kieran Bingham
2021-06-18 19:33 ` Laurent Pinchart
2021-09-01 22:07   ` Kieran Bingham
2021-09-01 22:08     ` Laurent Pinchart
2021-06-19  7:25 ` Biju Das

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.