From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: drm pixel formats update
Date: Thu, 17 Nov 2011 00:16:57 +0200 [thread overview]
Message-ID: <20111116221657.GP3477@intel.com> (raw)
In-Reply-To: <20111116212620.07c8bf23@lxorguk.ukuu.org.uk>
On Wed, Nov 16, 2011 at 09:26:20PM +0000, Alan Cox wrote:
> > I think the only format in my list where I didn't use an existing fourcc
> > is I420/IYUV. And BTW, for that one I used the same "fake" fourcc that
>
> Right but you redefine all sorts of stuff in the driver in your patch to
> non FourCC names which is just confusing (and painful given the format
> picked)
Sorry, now I lost you completely. Care to elaborate, or perhaps
point to a specific line or lines in the patch?
> > v4l2 uses (YU12).
> >
> > And that brings another matter to the table. How should we deal with
> > duplicate fourccs? I420/IYUV and YUY2/YUYV come to mind.
>
> Just accept both. FourCC as with all API's is not perfect
>
> > Also, if I now add these ad-hoc fourccs for the RGB formats, and some
> > time later someone comes in with a format with a conflicting official
> > fourcc, what should we do?
>
> One possibility I suggested originally was to mix FourCC codes and native
> formats which are numbered. That works fine in both endiannesses in
> theory because you'll always have a \0 in it which is invalid FourCC
>
> ie just number the Linux specific DRM formats 0, 1, 2, 3, 4, 5, ...
I suggested a running number too. But I'd rather leave the fourccs to
user space completely. But if people insist that the kernel should eat
them too, we could just convert them to the simple number format in
some helper function, to isolate the rest of the code from fourccs.
And then there'd be no point in even defining any fourcc stuff in the
headers, as everyone knows how to construct them.
> > Oh and one extra detail just occured to me regarding the three plane
> > formats. Should we even define formats for both the YUV vs. YVU
> > variant. Seeing as we now have independent handles and offsets for
> > each plane, we can make do with just one format definition.
>
> I think so - or the helper should do the translation and flip the planes.
> We want the user to get flexibility and the driver to be as simple as
> possible.
>
> (and btw I've no problem at all with the idea that you can pass in a
> FourCC *or* a format specifying structure, or with an internal API where
> a fourCC is always internally turned into a struct of offsets and other
> useful info before hitting the drivers)
Even if there's such a structure, I think it's still beneficial to have
a constant identifier for each format. It allows you utilize switch
statements, whereas otherwise you'd possibly need to look at multiple
bits of information inside the structure.
--
Ville Syrjälä
Intel OTC
next prev parent reply other threads:[~2011-11-16 22:14 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-16 18:42 drm pixel formats update ville.syrjala
2011-11-16 18:42 ` [PATCH 1/2] drm: Add a missing ')' ville.syrjala
2011-11-16 18:42 ` [PATCH 2/2] drm: Redefine pixel formats ville.syrjala
2011-11-16 19:16 ` Ilyes Gouta
2011-11-16 22:28 ` Ville Syrjälä
2011-11-17 7:52 ` Michel Dänzer
2011-11-17 13:06 ` Ville Syrjälä
2011-11-17 14:00 ` Michel Dänzer
2011-11-17 14:40 ` Ville Syrjälä
2011-11-16 19:13 ` drm pixel formats update James Simmons
2011-11-16 19:54 ` Alan Cox
2011-11-16 21:19 ` Ville Syrjälä
2011-11-16 21:23 ` Jesse Barnes
2011-11-16 22:20 ` Ville Syrjälä
2011-11-17 17:06 ` Jesse Barnes
2011-11-17 21:05 ` Rob Clark
2011-11-16 21:26 ` Alan Cox
2011-11-16 22:16 ` Ville Syrjälä [this message]
2011-11-29 12:10 ` Laurent Pinchart
2011-11-29 12:10 ` Laurent Pinchart
2011-11-29 13:30 ` Hans Verkuil
2011-11-29 13:30 ` Hans Verkuil
2011-11-29 16:13 ` Tomi Valkeinen
2011-11-29 16:13 ` Tomi Valkeinen
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=20111116221657.GP3477@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dri-devel@lists.freedesktop.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 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.