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


Groups > linux.kernel > #1634414 > unrolled thread

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

Started byGerd Hoffmann <kraxel@redhat.com>
First post2017-05-02 15:40 +0200
Last post2017-05-02 15:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/3] drm: fourcc byteorder: add DRM_FORMAT_CPU_* Gerd Hoffmann <kraxel@redhat.com> - 2017-05-02 15:40 +0200

#1634414 — [PATCH 2/3] drm: fourcc byteorder: add DRM_FORMAT_CPU_*

FromGerd Hoffmann <kraxel@redhat.com>
Date2017-05-02 15:40 +0200
Subject[PATCH 2/3] drm: fourcc byteorder: add DRM_FORMAT_CPU_*
Message-ID<tCGc2-7i0-5@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web