[Intel-gfx] [PATCH v1] sna: fix of byteswap.h absence on bsd

Sergii Romantsov sergii.romantsov at gmail.com
Thu Jan 10 09:42:45 UTC 2019


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 at intel.com>
CC: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Sergii Romantsov <sergii.romantsov at globallogic.com>
---
 src/sna/sna_video.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/sna/sna_video.c b/src/sna/sna_video.c
index cf28497..b7aa662 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_
-- 
2.7.4



More information about the Intel-gfx mailing list