From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org,
dri-devel@lists.freedesktop.org, FlorianSchandinat@gmx.de
Subject: Re: [PATCH/RFC] fbdev: Add FOURCC-based format configuration API
Date: Tue, 21 Jun 2011 20:49:14 +0000 [thread overview]
Message-ID: <BANLkTim6wUaeZCya=9dMvU7iHj4W4E57Fg@mail.gmail.com> (raw)
In-Reply-To: <1308670579-15138-1-git-send-email-laurent.pinchart@ideasonboard.com>
Hi Laurent,
On Tue, Jun 21, 2011 at 17:36, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> +The following types and visuals are supported.
> +
> +- FB_TYPE_PACKED_PIXELS
> +
> +- FB_TYPE_PLANES
You forgot FB_TYPE_INTERLEAVED_PLANES, FB_TYPE_TEXT, and
FB_TYPE_VGA_PLANES. Ah, that's the "feel free to extend the API doc" :-)
> +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).
What about storing the FOURCC value in nonstd instead?
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.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2011-06-21 20:49 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 [this message]
2011-06-21 22:31 ` Laurent Pinchart
2011-06-22 5:45 ` Florian Tobias Schandinat
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='BANLkTim6wUaeZCya=9dMvU7iHj4W4E57Fg@mail.gmail.com' \
--to=geert@linux-m68k.org \
--cc=FlorianSchandinat@gmx.de \
--cc=dri-devel@lists.freedesktop.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).