Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1629228

[PATCH 2/6] drm: fourcc byteorder: add DRM_FORMAT_CPU_*

Path csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod
From Gerd Hoffmann <kraxel@redhat.com>
Newsgroups linux.kernel
Subject [PATCH 2/6] drm: fourcc byteorder: add DRM_FORMAT_CPU_*
Date Mon, 24 Apr 2017 08:30:01 +0200
Message-ID <tzFFv-3rT-9@gated-at.bofh.it> (permalink)
References <tzFFv-3rT-3@gated-at.bofh.it>
X-Original-To dri-devel@lists.freedesktop.org
Dmarc-Filter OpenDMARC Filter v1.3.2 mx1.redhat.com 17A5780465
Authentication-Results ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kraxel@redhat.com
Dkim-Filter OpenDKIM Filter v2.11.0 mx1.redhat.com 17A5780465
X-Scanned-By MIMEDefang 2.79 on 10.5.11.14
X-Greylist Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 24 Apr 2017 06:25:45 +0000 (UTC)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 33
Organization linux.* mail to news gateway
X-Original-Cc Ville Syrjälä <ville.syrjala@linux.intel.com>, Daniel Vetter <daniel.vetter@intel.com>, Pekka Paalanen <ppaalanen@gmail.com>, Ilia Mirkin <imirkin@alum.mit.edu>, Michel Dänzer <michel@daenzer.net>, Alex Deucher <alexdeucher@gmail.com>, amd-gfx@lists.freedesktop.org, Jani Nikula <jani.nikula@linux.intel.com>, Sean Paul <seanpaul@chromium.org>, David Airlie <airlied@linux.ie>, Gerd Hoffmann <kraxel@redhat.com>, linux-kernel@vger.kernel.org (open list)
X-Original-Date Mon, 24 Apr 2017 08:25:28 +0200
X-Original-Message-ID <20170424062532.26722-3-kraxel@redhat.com>
X-Original-References <20170424062532.26722-1-kraxel@redhat.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1629228

Show key headers only | View raw


Add fourcc variants in cpu byte order.  With these at hand we don't
need #ifdefs in drivers want support framebuffers in cpu endianess.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/drm/drm_fourcc.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h
index 6942e84b6e..cae05153e8 100644
--- a/include/drm/drm_fourcc.h
+++ b/include/drm/drm_fourcc.h
@@ -25,6 +25,18 @@
 #include <linux/types.h>
 #include <uapi/drm/drm_fourcc.h>
 
+/*
+ * DRM formats are little endian.  define cpu endian variants here, to
+ * reduce the #ifdefs needed in drivers.
+ */
+#ifdef __BIG_ENDIAN
+# define DRM_FORMAT_CPU_XRGB8888 DRM_FORMAT_BGRX8888
+# define DRM_FORMAT_CPU_ARGB8888 DRM_FORMAT_BGRA8888
+#else
+# define DRM_FORMAT_CPU_XRGB8888 DRM_FORMAT_XRGB8888
+# define DRM_FORMAT_CPU_ARGB8888 DRM_FORMAT_ARGB8888
+#endif
+
 struct drm_device;
 struct drm_mode_fb_cmd2;
 
-- 
2.9.3

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 2/6] drm: fourcc byteorder: add DRM_FORMAT_CPU_* Gerd Hoffmann <kraxel@redhat.com> - 2017-04-24 08:30 +0200

csiph-web