xf86-video-intel: 2 commits - configure.ac src/intel_device.c src/sna/sna_cpuid.h
Chris Wilson
ickle at kemper.freedesktop.org
Sun Aug 31 03:52:14 PDT 2014
configure.ac | 18 ++++++++++++++++++
src/intel_device.c | 9 ++++++---
src/sna/sna_cpuid.h | 4 +---
3 files changed, 25 insertions(+), 6 deletions(-)
New commits:
commit 2c564c04bcde88d730ca111acfb6798bdf0d66da
Author: Jonathan Gray <jsg at jsg.id.au>
Date: Sun Aug 31 18:48:56 2014 +1000
configure: check for cpuid.h
Instead of checking for a particular version of GCC check for
a cpuid.h with __cpuid_count. This allows cpuid.h to be
provided for older/different compilers.
Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
[ickle: Delete the bare and redundant config.h]
diff --git a/configure.ac b/configure.ac
index 4f1cff7..c24b369 100644
--- a/configure.ac
+++ b/configure.ac
@@ -208,6 +208,24 @@ fi
PKG_CHECK_MODULES(X11, [x11 xrender xrandr xext xfixes cairo cairo-xlib-xrender pixman-1 libpng], [x11="yes"], [x11="no"])
AM_CONDITIONAL(HAVE_X11, test "x$x11" = "xyes")
+cpuid="yes"
+AC_TRY_LINK([
+ #include <cpuid.h>
+ #include <stddef.h>
+ ],
+ [
+ int eax, ebx, ecx, edx;
+ if (__get_cpuid_max(0, NULL) < 4)
+ return 0;
+ __cpuid_count(4, 0, eax, ebx, ecx, edx);
+ ],
+ [cpuid="yes"],
+ [cpuid="no"]
+)
+if test "x$cpuid" = "xyes"; then
+ AC_DEFINE(HAVE_CPUID_H,1,[Found a useable cpuid.h])
+fi
+
shm=yes
AC_CHECK_HEADERS([sys/ipc.h sys/ipc.h], [], [shm="no"])
AC_CHECK_HEADERS([X11/extensions/XShm.h], [], [shm="no"], [
diff --git a/src/sna/sna_cpuid.h b/src/sna/sna_cpuid.h
index ed28a0a..430cc64 100644
--- a/src/sna/sna_cpuid.h
+++ b/src/sna/sna_cpuid.h
@@ -30,9 +30,7 @@
#ifndef SNA_CPUID_H
#define SNA_CPUID_H
-#include "compiler.h"
-
-#if HAS_GCC(4, 4) /* for __cpuid_count() */
+#ifdef HAVE_CPUID_H
#include <cpuid.h>
#else
#define __get_cpuid_max(x, y) 0
commit e8ad453a0ae9d701b41cc026d5d40f55dd4590c5
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Aug 31 11:45:57 2014 +0100
intel: Only include sys/mount.h on Linux
We only automount debugfs for Linux, but sys/mount.h on BSD has unmet
dependencies breaking the build.
Reported-by: Jonathan Gray <jsg at jsg.id.au>
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/intel_device.c b/src/intel_device.c
index 9a2ebb0..2e16ce5 100644
--- a/src/intel_device.c
+++ b/src/intel_device.c
@@ -30,7 +30,6 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/mount.h>
#include <assert.h>
#include <string.h>
#include <unistd.h>
@@ -126,9 +125,11 @@ static int drm_get_minor(int fd)
return st.st_rdev & 0x63;
}
+#if __linux__
+#include <sys/mount.h>
+
static void dump_debugfs(ScrnInfoPtr scrn, int fd, const char *name)
{
-#if __linux__
char path[80];
int minor;
@@ -150,8 +151,10 @@ static void dump_debugfs(ScrnInfoPtr scrn, int fd, const char *name)
umount("X-debug");
return;
}
-#endif
}
+#else
+static void dump_debugfs(ScrnInfoPtr scrn, int fd, const char *name) { }
+#endif
static void dump_clients_info(ScrnInfoPtr scrn, int fd)
{
More information about the xorg-commit
mailing list