All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Longerbeam <slongerbeam@gmail.com>
To: Philipp Zabel <p.zabel@pengutronix.de>, linux-media@vger.kernel.org
Cc: Nicolas Dufresne <nicolas@ndufresne.ca>, kernel@pengutronix.de
Subject: Re: [PATCH v3 10/16] gpu: ipu-v3: image-convert: select optimal seam positions
Date: Wed, 17 Oct 2018 16:44:06 -0700	[thread overview]
Message-ID: <7c8c78c0-48ce-4768-c327-7797afec31ad@gmail.com> (raw)
In-Reply-To: <1539774637.4729.3.camel@pengutronix.de>


On 10/17/18 4:10 AM, Philipp Zabel wrote:
> On Fri, 2018-10-12 at 17:33 -0700, Steve Longerbeam wrote:
>> On 09/18/2018 02:34 AM, Philipp Zabel wrote:
>>
>> <snip>
>>> +/*
>>> + * Tile left edges are required to be aligned to multiples of 8 bytes
>>> + * by the IDMAC.
>>> + */
>>> +static inline u32 tile_left_align(const struct ipu_image_pixfmt *fmt)
>>> +{
>>> +	return fmt->planar ? 8 * fmt->uv_width_dec : 64 / fmt->bpp;
>>> +}
>> <snip>
>>
>> As I indicated, shouldn't this be
>>
>> return fmt->planar ? 8 * fmt->uv_width_dec : 8;
>>
>> ?
>>
>> Just from a unit analysis perspective, "64 / fmt->bp" has
>> units of pixels / 8-bytes, it should have units of bytes.
> The tile alignment is in pixels, not in bytes.


Ah, yes of course you are right, I used to know this :) I am
loosing track of this code.


>   For 16-bit and 32-bit
> packed formats, we only need to align to 4 or 2 pixels, respectively,
> as the LCM of 8-byte alignment and 2-byte or 4-byte pixel size is
> always 8 bytes.


Yes I agree, the LCM of 8-byte alignment and bytes-per-pixel should
be the tile left edge alignment in pixels.


> But now that you pointed it out, it is quite obvious that this can't
> work for 24-bit packed formats. Here the LCM of 8-byte alignment and 3-
> byte pixels is 24 bytes, or 8 pixels.
>
> How about:
>
> 	if (fmt->planar)
> 		return fmt->uv_packed ? 8 : 8 * fmt->uv_width_dec;
> 	else
> 		return fmt->bpp == 32 ? 2 : fmt->bpp == 16 ? 4 : 8;


Yep, that looks better. I tested this and it works fine.

Steve

  reply	other threads:[~2018-10-18  7:42 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18  9:34 [PATCH v3 00/16] i.MX media mem2mem scaler Philipp Zabel
2018-09-18  9:34 ` [PATCH v3 01/16] media: imx: add mem2mem device Philipp Zabel
2018-10-18 22:53   ` Tim Harvey
2018-10-19  9:53     ` Philipp Zabel
2018-10-19 20:19       ` Steve Longerbeam
2018-10-19 23:54         ` Tim Harvey
2018-10-21 17:43         ` Philipp Zabel
2018-10-23 23:23           ` Steve Longerbeam
2018-09-18  9:34 ` [PATCH v3 02/16] gpu: ipu-cpmem: add WARN_ON_ONCE() for unaligned dma buffers Philipp Zabel
2018-09-18  9:34 ` [PATCH v3 03/16] gpu: ipu-v3: ipu-ic: allow to manually set resize coefficients Philipp Zabel
2018-09-18  9:34 ` [PATCH v3 04/16] gpu: ipu-v3: image-convert: prepare for per-tile configuration Philipp Zabel
2018-09-18  9:34 ` [PATCH v3 05/16] gpu: ipu-v3: image-convert: calculate per-tile resize coefficients Philipp Zabel
2018-09-18  9:34 ` [PATCH v3 06/16] gpu: ipu-v3: image-convert: reconfigure IC per tile Philipp Zabel
2018-09-18  9:34 ` [PATCH v3 07/16] gpu: ipu-v3: image-convert: store tile top/left position Philipp Zabel
2018-09-18  9:34 ` [PATCH v3 08/16] gpu: ipu-v3: image-convert: calculate tile dimensions and offsets outside fill_image Philipp Zabel
2018-09-18  9:34 ` [PATCH v3 09/16] gpu: ipu-v3: image-convert: move tile alignment helpers Philipp Zabel
2018-09-18  9:34 ` [PATCH v3 10/16] gpu: ipu-v3: image-convert: select optimal seam positions Philipp Zabel
2018-10-13  0:33   ` Steve Longerbeam
2018-10-17 11:10     ` Philipp Zabel
2018-10-17 23:44       ` Steve Longerbeam [this message]
2018-09-18  9:34 ` [PATCH v3 11/16] gpu: ipu-v3: image-convert: fix debug output for varying tile sizes Philipp Zabel
2018-09-18  9:34 ` [PATCH v3 12/16] gpu: ipu-v3: image-convert: relax alignment restrictions Philipp Zabel
2018-09-18  9:34 ` [PATCH v3 13/16] gpu: ipu-v3: image-convert: fix bytesperline adjustment Philipp Zabel
2018-09-18  9:34 ` [PATCH v3 14/16] gpu: ipu-v3: image-convert: add some ASCII art to the exposition Philipp Zabel
2018-09-18  9:34 ` [PATCH v3 15/16] gpu: ipu-v3: image-convert: disable double buffering if necessary Philipp Zabel
2018-09-18  9:34 ` [PATCH v3 16/16] gpu: ipu-v3: image-convert: allow three rows or columns Philipp Zabel
2018-10-13  0:29 ` [PATCH v3 00/16] i.MX media mem2mem scaler Steve Longerbeam
2018-10-17 23:46   ` Steve Longerbeam
2018-10-19 12:18     ` Philipp Zabel

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=7c8c78c0-48ce-4768-c327-7797afec31ad@gmail.com \
    --to=slongerbeam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-media@vger.kernel.org \
    --cc=nicolas@ndufresne.ca \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.