summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergii Romantsov <sergii.romantsov@gmail.com>2019-01-10 11:42:45 +0200
committerChris Wilson <chris@chris-wilson.co.uk>2019-01-10 10:01:58 +0000
commit985553dff9d9de255edb6acb0ae85117ceb3e76c (patch)
treefea8e5de02a58d0b3fbf225d7ecd1f46774927d7
parente5ff8e1828f97891c819c919d7115c6e18b2eb1f (diff)
sna: fix of byteswap.h absence on bsd
OpenBSD, FreeBSD and NetBSD don't contains file byteswap.h. Used specifics of them. Fixes: 746ab3bb131d (sna: Added AYUV format support for textured and sprite video adapters.) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109268 CC: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> CC: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Sergii Romantsov <sergii.romantsov@globallogic.com>
-rw-r--r--src/sna/sna_video.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sna/sna_video.c b/src/sna/sna_video.c
index cf284975..b7aa6624 100644
--- a/src/sna/sna_video.c
+++ b/src/sna/sna_video.c
@@ -59,7 +59,17 @@
#include "intel_options.h"
#include <xf86xv.h>
+#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
+#include <sys/types.h>
+#include <sys/endian.h>
+#ifdef __OpenBSD__
+#define bswap_32 swap32
+#else
+#define bswap_32 bswap32
+#endif
+#else
#include <byteswap.h>
+#endif
#ifdef SNA_XVMC
#define _SNA_XVMC_SERVER_