linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin van der Gracht <robin@protonic.nl>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Marco Felsch <m.felsch@pengutronix.de>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Andreas Pretzsch <apr@cn-eng.de>,
	Robin van der Gracht <robin@protonic.nl>
Subject: [PATCH] media: i2c: tvp5150: Fix horizontal crop stop boundry
Date: Tue, 17 Sep 2019 09:14:42 +0200	[thread overview]
Message-ID: <20190917071442.24986-1-robin@protonic.nl> (raw)

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


             reply	other threads:[~2019-09-17  7:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17  7:14 Robin van der Gracht [this message]
2020-06-25 11:05 ` [PATCH] media: i2c: tvp5150: Fix horizontal crop stop boundry Hans Verkuil
2020-07-29  9:29   ` Marco Felsch
2020-08-03  7:57     ` robin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190917071442.24986-1-robin@protonic.nl \
    --to=robin@protonic.nl \
    --cc=apr@cn-eng.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).