linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel@collabora.com>
To: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	linux-media@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
	Kieran Bingham <kieran.bingham@ideasonboard.com>
Subject: Re: [PATCH] rcar-vin: Use bytes per line instead of width for UV offset
Date: Thu, 12 Sep 2019 00:43:25 +0100	[thread overview]
Message-ID: <598bc8159ae05b640608964628103018c8ce090b.camel@collabora.com> (raw)
In-Reply-To: <20190905212517.7872-1-niklas.soderlund+renesas@ragnatech.se>

Hello Niklas,

On Thu, 2019-09-05 at 23:25 +0200, Niklas Söderlund wrote:
> The image size is doubled for NV16 and is calculated as bytesperline *
> height * 2 to accommodate the split of UV data. When writing the offset
> to hardware width is used instead of bytesperline, fix this.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
>  drivers/media/platform/rcar-vin/rcar-dma.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c
> index c7859b329dd4f02a..af4f774149f08597 100644
> --- a/drivers/media/platform/rcar-vin/rcar-dma.c
> +++ b/drivers/media/platform/rcar-vin/rcar-dma.c
> @@ -703,8 +703,8 @@ static int rvin_setup(struct rvin_dev *vin)
>  	switch (vin->format.pixelformat) {
>  	case V4L2_PIX_FMT_NV16:
>  		rvin_write(vin,
> -			   ALIGN(vin->format.width * vin->format.height, 0x80),
> -			   VNUVAOF_REG);
> +			   ALIGN(vin->format.bytesperline * vin->format.height,
> +				 0x80), VNUVAOF_REG);

You can make your life easier by simply pulling the pixel format helper
and let someone figure out the math. See v4l2_fill_pixfmt and friends.

Avoiding these type of subtle issues is why we have them.

Eze


      parent reply	other threads:[~2019-09-11 23:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05 21:25 [PATCH] rcar-vin: Use bytes per line instead of width for UV offset Niklas Söderlund
2019-09-11 22:41 ` Kieran Bingham
2019-09-11 23:43 ` Ezequiel Garcia [this message]

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=598bc8159ae05b640608964628103018c8ce090b.camel@collabora.com \
    --to=ezequiel@collabora.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    /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).