All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Longerbeam <slongerbeam@gmail.com>
To: "Philipp Zabel" <p.zabel@pengutronix.de>,
	"Krzysztof Hałasa" <khalasa@piap.pl>
Cc: linux-media@vger.kernel.org, Tim Harvey <tharvey@gateworks.com>
Subject: Re: i.MX6 IPU CSI analog video input on Ventana
Date: Fri, 25 May 2018 16:21:19 -0700	[thread overview]
Message-ID: <dee0fb18-faf3-12b7-3014-d5b63a8b3e38@gmail.com> (raw)
In-Reply-To: <1527229949.4938.1.camel@pengutronix.de>

Hi Philipp,


On 05/24/2018 11:32 PM, Philipp Zabel wrote:
> On Thu, 2018-05-24 at 11:12 -0700, Steve Longerbeam wrote:
> [...]
>>> The following is required as well. Now the question is why we can't skip
>>> writing those odd UV rows. Anyway, with these 2 changes, I get a stable
>>> NTSC (and probably PAL) interlaced video stream.
>>>
>>> The manual says: Reduce Double Read or Writes (RDRW):
>>> This bit is relevant for YUV4:2:0 formats. For write channels:
>>> U and V components are not written to odd rows.
>>>
>>> How could it be so? With YUV420, are they normally written?
>> Well, given that this bit exists, and assuming I understand it correctly
>> (1),
>> I guess the U and V components for odd rows normally are placed on the
>> AXI bus. Which is a total waste of bus bandwidth because in 4:2:0,
>> the U and V components are the same for odd and even rows.
>>
>> In other words for writing 4:2:0 to memory, this bit should _always_ be set.
>>
>> (1) OTOH I don't really understand what this bit is trying to say.
>> Whether this bit is set or not, the data in memory is correct
>> for planar 4:2:0: y plane buffer followed by U plane of 1/4 size
>> (decimated by 2 in width and height), followed by Y plane of 1/4
>> size.
>>
>> So I assume it is saying that the IPU normally places U/V components
>> on the AXI bus for odd rows, that are identical to the even row values.
> Whether they are identical depends on the input format.

Right, this is the part I was missing, thanks for clarifying. The
even and odd chroma rows coming into the IDMAC from the
CSI (or IC) may not be identical if the CSI has captured 4:4:4
(or 4:2:2 yeah? 4:2:2 is only decimated in width not height).

But still, when the IDMAC has finished pixel packing/unpacking and
is writing 4:2:0 to memory, it should always skip overwriting the even
rows with the odd rows, whether or not it has received identical chroma
even/odd lines from the CSI.

Unless interweave is enabled :) See below.
>
> The IDMAC always gets fed AYUV32 from the CSI or IC.
> If the CSI captures YUV 4:2:x, odd and even lines will have the same
> chroma values. But if the CSI captures YUV 4:4:4 (or RGB, fed through
> the IC), we can have AYUV32 input with different chroma values on even
> and odd lines.
> In that case the IPU just writes the even chroma line and then
> overwrites it with the odd line, unless the double write reduction bit
> is set.
>
>> IOW somehow those identical odd rows are dropped before writing to
>> the U/V planes in memory.
> potentially identical.

Right.

>
>> Philipp please chime in if you have something to add here.
> I suppose the bit could be used to choose to write the chroma values of
> odd instead of even lines for 4:4:4 inputs, at the cost of increased
> memory bandwidth usage.
>
>> Steve
>>
>>> OTOH it seems that not only UV is broken with this bit set.
>>> Y is broken as well.
> Maybe scanline interlave and double write reduction can't be used at the
> same time?

Yes, I just verified that. I went back to the SabreLite with the
progressive output OV5640, and double-write-reduction for
4:2:0 capture works fine, the images are correct.

Steve

  parent reply	other threads:[~2018-05-25 23:21 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10  8:19 i.MX6 IPU CSI analog video input on Ventana Krzysztof Hałasa
2018-05-10 16:32 ` Steve Longerbeam
2018-05-11  5:37   ` Krzysztof Hałasa
2018-05-11 17:35     ` Steve Longerbeam
2018-05-18 17:28       ` Krzysztof Hałasa
2018-05-18 17:56         ` Tim Harvey
2018-05-21  5:51           ` Krzysztof Hałasa
2018-05-21  8:09         ` Krzysztof Hałasa
2018-05-21 15:55           ` Tim Harvey
2018-05-21 21:25           ` Steve Longerbeam
2018-05-22 10:48             ` Krzysztof Hałasa
2018-05-24 15:56             ` Krzysztof Hałasa
2018-05-24 18:12               ` Steve Longerbeam
2018-05-24 20:48                 ` Steve Longerbeam
2018-05-24 21:33                   ` Steve Longerbeam
2018-05-25  6:34                     ` Philipp Zabel
2018-05-25  5:21                   ` Krzysztof Hałasa
2018-05-25  6:32                 ` Philipp Zabel
2018-05-25  7:18                   ` Krzysztof Hałasa
2018-05-25 23:39                     ` Steve Longerbeam
2018-05-29  7:26                       ` Krzysztof Hałasa
2018-05-29 14:00                         ` Steve Longerbeam
2018-05-30  8:53                           ` Krzysztof Hałasa
2018-05-30 17:57                             ` Steve Longerbeam
2018-05-30 18:46                               ` Krzysztof Hałasa
2018-05-30 20:56                                 ` Steve Longerbeam
2018-05-31  6:29                                   ` Philipp Zabel
2018-06-01  5:23                                     ` Krzysztof Hałasa
2018-06-02 17:33                                     ` Steve Longerbeam
2018-06-04  8:38                                       ` Philipp Zabel
2018-06-01 10:02                                   ` Krzysztof Hałasa
2018-06-01 13:13                                     ` Philipp Zabel
2018-06-02 17:45                                       ` Steve Longerbeam
2018-06-04  7:33                                         ` Krzysztof Hałasa
2018-06-04  8:47                                         ` Philipp Zabel
2018-06-04  8:58                                           ` Krzysztof Hałasa
2018-10-17 20:38                                             ` Tim Harvey
     [not found]                                               ` <57dfdc0b-5f04-e10a-2ffd-c7ba561fe7ce@gmail.com>
2018-10-17 23:05                                                 ` Tim Harvey
2018-10-17 23:37                                                   ` Steve Longerbeam
2018-10-18 17:56                                                     ` Tim Harvey
2018-10-19 20:06                                                       ` Steve Longerbeam
2018-10-19  9:45                                                 ` Philipp Zabel
2018-06-04  7:06                                       ` Krzysztof Hałasa
2018-05-25 23:21                   ` Steve Longerbeam [this message]
2018-06-01 13:52                     ` Philipp Zabel
2018-05-25  7:07                 ` Krzysztof Hałasa
2018-05-22  9:41           ` Franz Melchior
2018-05-11  6:11 ` Franz Melchior

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=dee0fb18-faf3-12b7-3014-d5b63a8b3e38@gmail.com \
    --to=slongerbeam@gmail.com \
    --cc=khalasa@piap.pl \
    --cc=linux-media@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=tharvey@gateworks.com \
    /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.