From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Michel Dänzer" <michel@daenzer.net>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm: Redefine pixel formats
Date: Thu, 17 Nov 2011 16:40:23 +0200 [thread overview]
Message-ID: <20111117144023.GU3477@intel.com> (raw)
In-Reply-To: <1321538417.3794.104.camel@thor.local>
On Thu, Nov 17, 2011 at 03:00:17PM +0100, Michel Dänzer wrote:
> On Don, 2011-11-17 at 15:06 +0200, Ville Syrjälä wrote:
> > On Thu, Nov 17, 2011 at 08:52:05AM +0100, Michel Dänzer wrote:
> > > On Mit, 2011-11-16 at 20:42 +0200, ville.syrjala@linux.intel.com wrote:
> > > >
> > > > Name the formats as DRM_FORMAT_X instead of DRM_FOURCC_X. Use consistent
> > > > names, especially for the RGB formats. Component order and byte order are
> > > > now strictly specified for each format.
> > > >
> > > > The RGB format naming follows a convention where the components names
> > > > and sizes are listed from left to right, matching the order within a
> > > > single pixel from most significant bit to least significant bit. Lower
> > > > case letters are used when listing the components to improve
> > > > readablility. I believe this convention matches the one used by pixman.
> > >
> > > The RGB formats are all defined in the CPU native byte order. But e.g.
> > > pre-R600 Radeons can only scan out little endian formats. For the
> > > framebuffer device, we use GPU byte swapping facilities to make the
> > > pixels appear to the CPU in its native byte order, so these format
> > > definitions make sense for that. But I'm not sure they make sense for
> > > the KMS APIs, e.g. the userspace drivers don't use these facilities but
> > > handle byte swapping themselves.
> >
> > Hmm. So who decides whether GPU byte swapping is needed when you eg.
> > mmap() some buffer?
>
> The userspace drivers.
Hmm. OK. So I guess we should define the formats as little endian then.
Supposing we also need big endian formats in the future, we could just
define an extra flag like so:
#define DRM_FORMAT_BIG_ENDIAN (1<<31)
which would be ORed with the fourcc to get a big endian version of the
format. Otherwise we have to duplicate the formats for big endian as
well.
--
Ville Syrjälä
Intel OTC
next prev parent reply other threads:[~2011-11-17 14:38 UTC|newest]
Thread overview: 21+ 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ä [this message]
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ä
2011-11-29 12:10 ` Laurent Pinchart
2011-11-29 13:30 ` Hans Verkuil
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=20111117144023.GU3477@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=michel@daenzer.net \
/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