xf86-video-intel: src/sna/sna_cpu.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Feb 26 00:17:56 PST 2013


 src/sna/sna_cpu.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

New commits:
commit 528dbf9ebb2688f476ef283be59d0f2232159dcb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Feb 26 08:15:47 2013 +0000

    sna: Fix build on older GCC for cpuid()
    
    We need to double check that the features we look for are supported by
    the compiler before doing so.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_cpu.c b/src/sna/sna_cpu.c
index 65f6e04..c669eb8 100644
--- a/src/sna/sna_cpu.c
+++ b/src/sna/sna_cpu.c
@@ -31,8 +31,14 @@
 
 #include "sna.h"
 
+#if defined(__GNUC__) && (__GNUC__ >= 4) /* 4.4 */
+
 #include <cpuid.h>
 
+#ifndef bit_AVX2
+#define bit_AVX2 (1<<5)
+#endif
+
 unsigned sna_cpu_detect(void)
 {
 	unsigned int eax, ebx, ecx, edx;
@@ -74,3 +80,12 @@ unsigned sna_cpu_detect(void)
 
 	return features;
 }
+
+#else
+
+unsigned sna_cpu_detect(void)
+{
+	return 0;
+}
+
+#endif


More information about the xorg-commit mailing list