media: i2c: tvp5150: Fix horizontal crop stop boundry
PATCH 1/1 media: i2c: tvp5150: Fix horizontal crop stop boundry
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.
--- drivers/media/i2c/tvp5150.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/tvp5150.c +2 -2
@@ -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,
Signature · 1 line
2.20.1
Quoted 3 lines · 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.
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
Quoted 24 lines
Signed-off-by Robin van der Gracht <[email protected]>--- drivers/media/i2c/tvp5150.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/media/i2c/tvp5150.c +2
-2@@ -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,
Hi,
Quoted 9 lines · Hans Verkuil
Quoted 3 lines · 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.
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
Quoted 30 lines
Regards,
Hans
Quoted 24 lines
Signed-off-by Robin van der Gracht <[email protected]>--- drivers/media/i2c/tvp5150.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/media/i2c/tvp5150.c +2
-2@@ -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,
Signature · 4 lines
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 |
Marco,
Quoted 8 lines · Marco Felsch
Hi,
Quoted 5 lines · Hans Verkuil
Quoted 3 lines · 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.
Quoted 7 lines
Quoted 4 lines
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