linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: davinci-linux-open-source@linux.davincidsp.com,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Sakari Ailus <sakari.ailus@iki.fi>,
	LMML <linux-media@vger.kernel.org>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Subject: Re: [PATCH v7 1/2] media: add new mediabus format enums for dm365
Date: Mon, 30 Jul 2012 21:24:17 +0200	[thread overview]
Message-ID: <5016DF61.2010002@gmail.com> (raw)
In-Reply-To: <1527741.DUREJZiXMg@avalon>

Hi Laurent,

On 07/30/2012 09:06 PM, Laurent Pinchart wrote:
>>>> -	bus. Possible values are YUYV, UYVY, YVYU and VYUY.</para></listitem>
>>>> +	bus. Possible values are YUYV, UYVY, YVYU and VYUY for formats with
> no
>>>> +	dummy bit, and YDYUYDYV, YDYVYDYU, YUYDYVYD and YVYDYUYD for YDYC
>>>> formats. +	</para></listitem>
>>>>
>>>>   	<listitem><para>The number of bits per pixel component. All
> components
>>>>   	are
>>>>   	transferred on the same number of bits. Common values are 8, 10 and
>>>>   	12.</para>  </listitem>
>>>
>>> I dicussed dummy vs. padding (zeros) with Laurent and we concluded we
>>> should use zero padding instead. The difference is that when processing
>>> the pixels no extra operations are necessary to get rid of the dummy data
>>> when the dummy bits are actually zero --- which in practice always is the
>>> case.
>>>
>>> I'm not aware of hardware that would assign padding bits (in this very
>>> purpose) that are a part of writes the width of bus width something else
>>> than zeros. It wouldn't make much sense either.
>>>
>>> So I suggest that dummy is replaced by padding which is defined to be
>>> zero.
>>>
>>> The letter in the format name could be 'Z', for example.
>>>
>>> Hans: what do you think?
>>
>> Bad idea. First of all, some hardware or FPGA can insert different values
>> there. It's something that Cisco uses in some cases: it makes it easier to
>> identify the dummy values if they have a non-zero fixed value.
>>
>> Another reason for not doing this is when such formats are used to display
>> video: you don't want to force the software to fill in the dummy values
>> with a specific value for no good reason. That would only cost extra CPU
>> cycles.
> 
> On the other hand, when you process data that includes dummy bits stored in
> memory, knowing that the dummy bits are zero can save a mask operation.
> 
> I don't have a strong opinion whether we should use zero or dummy bits for
> media bus formats. For memory formats I'd be inclined to use zero bits (at
> least when capturing).

Perhaps it would make sense to assume those dummy bits have undefined
value and add some other API for retrieving/setting them where possible,
e.g. a v4l2 control ?

It just feels like an unnecessary API limitation to assume those dummy
bits are always zero.

--

Regards,
Sylwester

  parent reply	other threads:[~2012-07-30 19:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-27 10:55 [PATCH v7 0/2] add dm365 specific media formats Prabhakar Lad
2012-07-27 10:55 ` [PATCH v7 1/2] media: add new mediabus format enums for dm365 Prabhakar Lad
2012-07-27 22:01   ` Sakari Ailus
2012-07-30 18:36     ` Hans Verkuil
2012-07-30 19:06       ` Laurent Pinchart
2012-07-30 19:19         ` Hans Verkuil
2012-07-31 11:17           ` Sakari Ailus
2012-07-31 11:28             ` Hans Verkuil
2012-07-31 11:41               ` Sakari Ailus
2012-07-30 19:24         ` Sylwester Nawrocki [this message]
2012-07-27 10:55 ` [PATCH v7 2/2] v4l2: add new pixel formats supported on dm365 Prabhakar Lad
2012-08-02  0:29   ` Sakari Ailus
2012-08-02  6:49     ` Prabhakar Lad
2012-07-27 11:30 ` [PATCH v7 0/2] add dm365 specific media formats Laurent Pinchart
2012-07-27 11:41   ` Laurent Pinchart

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=5016DF61.2010002@gmail.com \
    --to=sylvester.nawrocki@gmail.com \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@iki.fi \
    /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).