From: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH/RFC] fbdev: Add FOURCC-based format configuration API
Date: Wed, 22 Jun 2011 05:45:45 +0000 [thread overview]
Message-ID: <4E018189.3020305@gmx.de> (raw)
In-Reply-To: <201106220031.57972.laurent.pinchart@ideasonboard.com>
Hi Geert, Laurent,
On 06/21/2011 10:31 PM, Laurent Pinchart wrote:
> Hi Geert,
>
> On Tuesday 21 June 2011 22:49:14 Geert Uytterhoeven wrote:
>> On Tue, Jun 21, 2011 at 17:36, Laurent Pinchart wrote:
>>> +The FOURCC-based API replaces format descriptions by four character
>>> codes +(FOURCC). FOURCCs are abstract identifiers that uniquely define a
>>> format +without explicitly describing it. This is the only API that
>>> supports YUV +formats. Drivers are also encouraged to implement the
>>> FOURCC-based API for RGB +and grayscale formats.
>>> +
>>> +Drivers that support the FOURCC-based API report this capability by
>>> setting +the FB_CAP_FOURCC bit in the fb_fix_screeninfo capabilities
>>> field. +
>>> +FOURCC definitions are located in the linux/videodev2.h header. However,
>>> and +despite starting with the V4L2_PIX_FMT_prefix, they are not
>>> restricted to V4L2 +and don't require usage of the V4L2 subsystem.
>>> FOURCC documentation is +available in
>>> Documentation/DocBook/v4l/pixfmt.xml.
>>> +
>>> +To select a format, applications set the FB_VMODE_FOURCC bit in the
>>> +fb_var_screeninfo vmode field, and set the fourcc field to the desired
>>> FOURCC. +The bits_per_pixel, red, green, blue, transp and nonstd fields
>>> must be set to +0 by applications and ignored by drivers. Note that the
>>> grayscale and fourcc +fields share the same memory location. Application
>>> must thus not set the +grayscale field to 0.
>>
>> These are the only parts I don't like: (ab)using the vmode field (this
>> isn't really a vmode flag), and the union of grayscale and fourcc (avoid
>> unions where possible).
>
> I've proposed adding a FB_NONSTD_FORMAT bit to the nonstd field as a FOURCC
> mode indicator in my initial RFC. Florian Tobias Schandinat wasn't very happy
> with that, and proposed using the vmode field instead.
>
> Given that there's virtually no fbdev documentation, whether the vmode field
> and/or nonstd field are good fit for a FOURCC mode indicator is subject to
> interpretation.
The reason for my suggestion is that the vmode field is accepted to contain only
flags and at least to me there is no hard line what is part of the video mode
and what is not. In contrast the nonstd field is already used in a lot of
different (incompatible) ways. I think if we only use the nonstd field for
handling FOURCC it is likely that some problems will appear.
>> What about storing the FOURCC value in nonstd instead?
>
> Wouldn't that be a union of nonstd and fourcc ? :-) FOURCC-based format
> setting will be a standard fbdev API, I'm not very keen on storing it in the
> nonstd field without a union.
>
>> As FOURCC values are always 4 ASCII characters (hence all 4 bytes must
>> be non-zero), I don't think there are any conflicts with existing values of
>> nonstd. To make it even safer and easier to parse, you could set bit 31 of
>> nonstd as a FOURCC indicator.
>
> I would then create a union between nonstd and fourcc, and document nonstd as
> being used for the legacy API only. Most existing drivers use a couple of
> nonstd bits only. The driver that (ab)uses nonstd the most is pxafb and uses
> bits 22:0. Bits 31:24 are never used as far as I can tell, so nonstd&
> 0xff000000 != 0 could be used as a FOURCC mode test.
>
> This assumes that FOURCCs will never have their last character set to '\0'. Is
> that a safe assumption for the future ?
Yes, I think. The information I found indicates that space should be used for
padding, so a \0 shouldn't exist.
I think using only the nonstd field and requiring applications to check the
capabilities would be possible, although not fool proof ;)
Great work, Laurent, do you have plans to modify fbset to allow using this
format API from the command line?
Regards,
Florian Tobias Schandinat
next prev parent reply other threads:[~2011-06-22 5:45 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-17 22:07 [RFC] Standardize YUV support in the fbdev API Laurent Pinchart
2011-05-17 22:44 ` Felipe Contreras
2011-05-18 6:53 ` Hans Verkuil
2011-05-23 11:55 ` Marek Szyprowski
2011-05-23 12:09 ` Hans Verkuil
2011-05-18 0:21 ` Andy Walls
2011-05-18 1:09 ` Andy Walls
2011-05-20 22:33 ` Florian Tobias Schandinat
2011-05-23 21:00 ` Laurent Pinchart
2011-05-23 22:56 ` Florian Tobias Schandinat
2011-06-21 15:36 ` [PATCH/RFC] fbdev: Add FOURCC-based format configuration API Laurent Pinchart
2011-06-21 20:49 ` Geert Uytterhoeven
2011-06-21 22:31 ` Laurent Pinchart
2011-06-22 5:45 ` Florian Tobias Schandinat [this message]
2011-06-22 8:50 ` Laurent Pinchart
2011-06-23 16:08 ` Geert Uytterhoeven
2011-06-24 6:19 ` Paul Mundt
2011-06-24 18:55 ` Geert Uytterhoeven
2011-06-24 19:45 ` Florian Tobias Schandinat
2011-07-11 15:32 ` Laurent Pinchart
2011-07-25 10:30 ` Laurent Pinchart
2011-07-28 8:31 ` Guennadi Liakhovetski
2011-07-28 10:51 ` Laurent Pinchart
2011-07-31 20:32 ` Geert Uytterhoeven
2011-07-31 22:54 ` Florian Tobias Schandinat
2011-07-31 23:28 ` Laurent Pinchart
2011-07-31 23:58 ` Florian Tobias Schandinat
2011-08-01 14:11 ` Laurent Pinchart
2011-08-01 9:49 ` Geert Uytterhoeven
2011-08-11 17:19 ` Laurent Pinchart
2011-08-13 9:42 ` Geert Uytterhoeven
2011-07-31 23:30 ` 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=4E018189.3020305@gmx.de \
--to=florianschandinat@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert@linux-m68k.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
/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).