linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: i2c: tvp5150: Fix horizontal crop stop boundry
@ 2019-09-17  7:14 Robin van der Gracht
  2020-06-25 11:05 ` Hans Verkuil
  0 siblings, 1 reply; 4+ messages in thread
From: Robin van der Gracht @ 2019-09-17  7:14 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Marco Felsch, Philipp Zabel,
	Andreas Pretzsch, Robin van der Gracht

The value for AVID stop is relative to the width of the active video area,
not the maximum register value. Zero means equal and a negative value means
we're cropping on the right side.

Signed-off-by: Robin van der Gracht <robin@protonic.nl>
---
 drivers/media/i2c/tvp5150.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index f47cb9a023fb..6bc65ab5e8ab 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -1231,10 +1231,10 @@ __tvp5150_set_selection(struct v4l2_subdev *sd, struct v4l2_rect rect)
 	regmap_write(decoder->regmap, TVP5150_ACT_VD_CROP_ST_LSB,
 		     rect.left | (1 << TVP5150_CROP_SHIFT));
 	regmap_write(decoder->regmap, TVP5150_ACT_VD_CROP_STP_MSB,
-		     (rect.left + rect.width - TVP5150_MAX_CROP_LEFT) >>
+		     (rect.left + rect.width - TVP5150_H_MAX) >>
 		     TVP5150_CROP_SHIFT);
 	regmap_write(decoder->regmap, TVP5150_ACT_VD_CROP_STP_LSB,
-		     rect.left + rect.width - TVP5150_MAX_CROP_LEFT);
+		     rect.left + rect.width - TVP5150_H_MAX);
 }
 
 static int tvp5150_set_selection(struct v4l2_subdev *sd,
-- 
2.20.1


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

* Re: [PATCH] media: i2c: tvp5150: Fix horizontal crop stop boundry
  2019-09-17  7:14 [PATCH] media: i2c: tvp5150: Fix horizontal crop stop boundry Robin van der Gracht
@ 2020-06-25 11:05 ` Hans Verkuil
  2020-07-29  9:29   ` Marco Felsch
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Verkuil @ 2020-06-25 11:05 UTC (permalink / raw)
  To: Robin van der Gracht, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Marco Felsch, Philipp Zabel, Andreas Pretzsch

On 17/09/2019 09:14, Robin van der Gracht wrote:
> The value for AVID stop is relative to the width of the active video area,
> not the maximum register value. Zero means equal and a negative value means
> we're cropping on the right side.

While going through old unreviewed patches I came across this one (sorry Robin,
your patch fell through the cracks).

Can someone verify/test that this is correct? Marco perhaps?

Regards,

	Hans

> 
> Signed-off-by: Robin van der Gracht <robin@protonic.nl>
> ---
>  drivers/media/i2c/tvp5150.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
> index f47cb9a023fb..6bc65ab5e8ab 100644
> --- a/drivers/media/i2c/tvp5150.c
> +++ b/drivers/media/i2c/tvp5150.c
> @@ -1231,10 +1231,10 @@ __tvp5150_set_selection(struct v4l2_subdev *sd, struct v4l2_rect rect)
>  	regmap_write(decoder->regmap, TVP5150_ACT_VD_CROP_ST_LSB,
>  		     rect.left | (1 << TVP5150_CROP_SHIFT));
>  	regmap_write(decoder->regmap, TVP5150_ACT_VD_CROP_STP_MSB,
> -		     (rect.left + rect.width - TVP5150_MAX_CROP_LEFT) >>
> +		     (rect.left + rect.width - TVP5150_H_MAX) >>
>  		     TVP5150_CROP_SHIFT);
>  	regmap_write(decoder->regmap, TVP5150_ACT_VD_CROP_STP_LSB,
> -		     rect.left + rect.width - TVP5150_MAX_CROP_LEFT);
> +		     rect.left + rect.width - TVP5150_H_MAX);
>  }
>  
>  static int tvp5150_set_selection(struct v4l2_subdev *sd,
> 


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

* Re: [PATCH] media: i2c: tvp5150: Fix horizontal crop stop boundry
  2020-06-25 11:05 ` Hans Verkuil
@ 2020-07-29  9:29   ` Marco Felsch
  2020-08-03  7:57     ` robin
  0 siblings, 1 reply; 4+ messages in thread
From: Marco Felsch @ 2020-07-29  9:29 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: Robin van der Gracht, Mauro Carvalho Chehab, linux-media,
	linux-kernel, Philipp Zabel, Andreas Pretzsch

Hi,

On 20-06-25 13:05, Hans Verkuil wrote:
> On 17/09/2019 09:14, Robin van der Gracht wrote:
> > The value for AVID stop is relative to the width of the active video area,
> > not the maximum register value. Zero means equal and a negative value means
> > we're cropping on the right side.
> 
> While going through old unreviewed patches I came across this one (sorry Robin,
> your patch fell through the cracks).
> 
> Can someone verify/test that this is correct? Marco perhaps?

sorry for my long absence on this. I will test it next week if it is not
already to late.

Regards,
  Marco

> Regards,
> 
> 	Hans
> 
> > 
> > Signed-off-by: Robin van der Gracht <robin@protonic.nl>
> > ---
> >  drivers/media/i2c/tvp5150.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
> > index f47cb9a023fb..6bc65ab5e8ab 100644
> > --- a/drivers/media/i2c/tvp5150.c
> > +++ b/drivers/media/i2c/tvp5150.c
> > @@ -1231,10 +1231,10 @@ __tvp5150_set_selection(struct v4l2_subdev *sd, struct v4l2_rect rect)
> >  	regmap_write(decoder->regmap, TVP5150_ACT_VD_CROP_ST_LSB,
> >  		     rect.left | (1 << TVP5150_CROP_SHIFT));
> >  	regmap_write(decoder->regmap, TVP5150_ACT_VD_CROP_STP_MSB,
> > -		     (rect.left + rect.width - TVP5150_MAX_CROP_LEFT) >>
> > +		     (rect.left + rect.width - TVP5150_H_MAX) >>
> >  		     TVP5150_CROP_SHIFT);
> >  	regmap_write(decoder->regmap, TVP5150_ACT_VD_CROP_STP_LSB,
> > -		     rect.left + rect.width - TVP5150_MAX_CROP_LEFT);
> > +		     rect.left + rect.width - TVP5150_H_MAX);
> >  }
> >  
> >  static int tvp5150_set_selection(struct v4l2_subdev *sd,
> > 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH] media: i2c: tvp5150: Fix horizontal crop stop boundry
  2020-07-29  9:29   ` Marco Felsch
@ 2020-08-03  7:57     ` robin
  0 siblings, 0 replies; 4+ messages in thread
From: robin @ 2020-08-03  7:57 UTC (permalink / raw)
  To: Marco Felsch
  Cc: Hans Verkuil, Mauro Carvalho Chehab, linux-media, linux-kernel,
	Philipp Zabel, Andreas Pretzsch

Marco,

On 2020-07-29 11:29, Marco Felsch wrote:
> Hi,
> 
> On 20-06-25 13:05, Hans Verkuil wrote:
>> On 17/09/2019 09:14, Robin van der Gracht wrote:
>> > The value for AVID stop is relative to the width of the active video area,
>> > not the maximum register value. Zero means equal and a negative value means
>> > we're cropping on the right side.
>> 
>> While going through old unreviewed patches I came across this one 
>> (sorry Robin,
>> your patch fell through the cracks).
>> 
>> Can someone verify/test that this is correct? Marco perhaps?
> 
> sorry for my long absence on this. I will test it next week if it is 
> not
> already to late.

Thanks. Let me know if you need more info.

Robin

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

end of thread, other threads:[~2020-08-03  8:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-17  7:14 [PATCH] media: i2c: tvp5150: Fix horizontal crop stop boundry Robin van der Gracht
2020-06-25 11:05 ` Hans Verkuil
2020-07-29  9:29   ` Marco Felsch
2020-08-03  7:57     ` robin

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