aboutsummaryrefslogtreecommitdiffstats
path: root/gfx.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-02-03 13:31:59 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-02-03 13:31:59 +0100
commitc2f9a4886c3597a6e15a67323313555bc9752a58 (patch)
tree7709784a08f1e48a664e7a43d054a68e2b7ad471 /gfx.c
parent930713cf44bcae9a91f92a1582f329643d38abfd (diff)
downloadfbida-c2f9a4886c3597a6e15a67323313555bc9752a58.tar.gz
format fixups
Diffstat (limited to 'gfx.c')
-rw-r--r--gfx.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/gfx.c b/gfx.c
new file mode 100644
index 0000000..dee4eae
--- /dev/null
+++ b/gfx.c
@@ -0,0 +1,51 @@
+#include <endian.h>
+#include <fcntl.h>
+#include <sys/types.h>
+
+#include <libdrm/drm_fourcc.h>
+
+#include "gfx.h"
+
+gfxfmt fmt_list[] = {
+ {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ .fourcc = DRM_FORMAT_XRGB8888,
+#else
+ .fourcc = DRM_FORMAT_BGRX8888,
+#endif
+ .cairo = CAIRO_FORMAT_RGB24,
+ .pixman = PIXMAN_x8r8g8b8,
+ .depth = 24,
+ .bpp = 32,
+ },
+ {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ .fourcc = DRM_FORMAT_ARGB8888,
+#else
+ .fourcc = DRM_FORMAT_BGRA8888,
+#endif
+ .cairo = CAIRO_FORMAT_ARGB32,
+ .pixman = PIXMAN_a8r8g8b8,
+ .depth = 24,
+ .bpp = 32,
+ },
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ {
+ .fourcc = DRM_FORMAT_RGB565,
+ .cairo = CAIRO_FORMAT_RGB16_565,
+ .pixman = PIXMAN_r5g6b5,
+ .depth = 16,
+ .bpp = 16,
+
+ },
+ {
+ .fourcc = DRM_FORMAT_XRGB2101010,
+ .cairo = CAIRO_FORMAT_RGB30,
+ .pixman = PIXMAN_x2r10g10b10,
+ .depth = 30,
+ .bpp = 32,
+ },
+#endif
+};
+
+uint32_t fmt_count = ARRAY_SIZE(fmt_list);