diff mbox

[02/16] rcar-vin: use rvin_reset_format() in S_DV_TIMINGS

Message ID 20170314185957.25253-3-niklas.soderlund+renesas@ragnatech.se (mailing list archive)
State New, archived
Headers show

Commit Message

Niklas Söderlund March 14, 2017, 6:59 p.m. UTC
Use rvin_reset_format() in rvin_s_dv_timings() instead of just resetting
a few fields. This fixes an issue where the field format was not
properly set after S_DV_TIMINGS.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Laurent Pinchart May 10, 2017, 1:22 p.m. UTC | #1
Hi Niklas,

Thank you for the patch.

On Tuesday 14 Mar 2017 19:59:43 Niklas Söderlund wrote:
> Use rvin_reset_format() in rvin_s_dv_timings() instead of just resetting
> a few fields. This fixes an issue where the field format was not
> properly set after S_DV_TIMINGS.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> b/drivers/media/platform/rcar-vin/rcar-v4l2.c index
> 69bc4cfea6a8aeb5..7ca27599b9982ffc 100644
> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> @@ -573,12 +573,8 @@ static int rvin_s_dv_timings(struct file *file, void
> *priv_fh, if (ret)
>  		return ret;
> 
> -	vin->source.width = timings->bt.width;
> -	vin->source.height = timings->bt.height;
> -	vin->format.width = timings->bt.width;
> -	vin->format.height = timings->bt.height;
> -
> -	return 0;
> +	/* Changing the timings will change the width/height */
> +	return rvin_reset_format(vin);

vin->source won't be updated anymore. Is this intentional ?

>  }
> 
>  static int rvin_g_dv_timings(struct file *file, void *priv_fh,
Niklas Söderlund May 20, 2017, 2:29 p.m. UTC | #2
Hi Laurent,

Thanks for your feedback.

On 2017-05-10 16:22:16 +0300, Laurent Pinchart wrote:
> Hi Niklas,
> 
> Thank you for the patch.
> 
> On Tuesday 14 Mar 2017 19:59:43 Niklas Söderlund wrote:
> > Use rvin_reset_format() in rvin_s_dv_timings() instead of just resetting
> > a few fields. This fixes an issue where the field format was not
> > properly set after S_DV_TIMINGS.
> > 
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > ---
> >  drivers/media/platform/rcar-vin/rcar-v4l2.c | 8 ++------
> >  1 file changed, 2 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> > b/drivers/media/platform/rcar-vin/rcar-v4l2.c index
> > 69bc4cfea6a8aeb5..7ca27599b9982ffc 100644
> > --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> > +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> > @@ -573,12 +573,8 @@ static int rvin_s_dv_timings(struct file *file, void
> > *priv_fh, if (ret)
> >  		return ret;
> > 
> > -	vin->source.width = timings->bt.width;
> > -	vin->source.height = timings->bt.height;
> > -	vin->format.width = timings->bt.width;
> > -	vin->format.height = timings->bt.height;
> > -
> > -	return 0;
> > +	/* Changing the timings will change the width/height */
> > +	return rvin_reset_format(vin);
> 
> vin->source won't be updated anymore. Is this intentional ?

Yes this is intentional. vin->source cache the frame width and height 
from the source subdevice, and this is done in .vidioc_s_fmt_vid_cap().  

This cacheing was due to a misunderstanding on my part in the port from 
soc_camera and the whole vin->source caching is removed in later patch 
when cleaning up the scaling code in the Gen3 enablement series.

> 
> >  }
> > 
> >  static int rvin_g_dv_timings(struct file *file, void *priv_fh,
> 
> -- 
> Regards,
> 
> Laurent Pinchart
>
diff mbox

Patch

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 69bc4cfea6a8aeb5..7ca27599b9982ffc 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -573,12 +573,8 @@  static int rvin_s_dv_timings(struct file *file, void *priv_fh,
 	if (ret)
 		return ret;
 
-	vin->source.width = timings->bt.width;
-	vin->source.height = timings->bt.height;
-	vin->format.width = timings->bt.width;
-	vin->format.height = timings->bt.height;
-
-	return 0;
+	/* Changing the timings will change the width/height */
+	return rvin_reset_format(vin);
 }
 
 static int rvin_g_dv_timings(struct file *file, void *priv_fh,