[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1493215062.23739.34.camel@redhat.com>
Date: Wed, 26 Apr 2017 15:57:42 +0200
From: Gerd Hoffmann <kraxel@...hat.com>
To: Eric Engestrom <eric.engestrom@...tec.com>
Cc: Michel Dänzer <michel@...nzer.net>,
Daniel Vetter <daniel.vetter@...el.com>,
amd-gfx@...ts.freedesktop.org,
open list <linux-kernel@...r.kernel.org>,
dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH 3/6] drm: fourcc byteorder: add bigendian support to
drm_mode_legacy_fb_format
> uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth)
> {
> uint32_t fmt;
> #ifdef __BIG_ENDIAN
> enum { LITTLE_ENDIAN = 0 };
> #else
> enum { LITTLE_ENDIAN = 1 };
> #endif
> /* ... */
>
> (using an enum for compile-time constness)
>
> and then
> fmt = DRM_FORMAT_ARGB8888;
> becomes
> fmt = LITTLE_ENDIAN ? DRM_FORMAT_ARGB8888 : DRM_FORMAT_BGRA8888;
>
> Might be easier to read than duplicating the whole switch?
Well, there are more differences, like rgb565 and xrgb2101010 not being
supported for bigendian, so it isn't *that* simple.
cheers,
Gerd
Powered by blists - more mailing lists