[mesa] Enable llvmpipe even on non-SSE2 machines (#909473)

Adam Jackson ajax at fedoraproject.org
Thu Apr 4 21:24:03 UTC 2013


commit ac0fbf9e295ff9b8414633521528b4dbbf3ea757
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Apr 4 17:23:59 2013 -0400

    Enable llvmpipe even on non-SSE2 machines (#909473)

 ...e-Work-without-sse2-if-llvm-is-new-enough.patch |   33 ++++++++++++++++++++
 mesa.spec                                          |    8 +++-
 2 files changed, 39 insertions(+), 2 deletions(-)
---
diff --git a/0001-llvmpipe-Work-without-sse2-if-llvm-is-new-enough.patch b/0001-llvmpipe-Work-without-sse2-if-llvm-is-new-enough.patch
new file mode 100644
index 0000000..dd7e11b
--- /dev/null
+++ b/0001-llvmpipe-Work-without-sse2-if-llvm-is-new-enough.patch
@@ -0,0 +1,33 @@
+From a499fd73461257f284bd3194f9198dc484acd373 Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax at redhat.com>
+Date: Thu, 4 Apr 2013 17:16:22 -0400
+Subject: [PATCH] llvmpipe: Work without sse2 if llvm is new enough
+
+At least on llvm 3.2 this appears to work fine.  Tested on an Athlon XP
+2600+, which has sse and 3dnow but not sse2.
+
+Signed-off-by: Adam Jackson <ajax at redhat.com>
+---
+ src/gallium/drivers/llvmpipe/lp_screen.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
+index 6700887..ebcf680 100644
+--- a/src/gallium/drivers/llvmpipe/lp_screen.c
++++ b/src/gallium/drivers/llvmpipe/lp_screen.c
+@@ -485,9 +485,10 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
+ {
+    struct llvmpipe_screen *screen;
+ 
+-#ifdef PIPE_ARCH_X86
+-   /* require SSE2 due to LLVM PR6960. */
+    util_cpu_detect();
++
++#if defined(PIPE_ARCH_X86) && HAVE_LLVM < 0x0302
++   /* require SSE2 due to LLVM PR6960. */
+    if (!util_cpu_caps.has_sse2)
+        return NULL;
+ #endif
+-- 
+1.8.2
+
diff --git a/mesa.spec b/mesa.spec
index c410542..4abc611 100644
--- a/mesa.spec
+++ b/mesa.spec
@@ -48,7 +48,7 @@
 Summary: Mesa graphics libraries
 Name: mesa
 Version: 9.1
-Release: 4%{?dist}
+Release: 5%{?dist}
 License: MIT
 Group: System Environment/Libraries
 URL: http://www.mesa3d.org
@@ -73,7 +73,7 @@ Patch9: mesa-8.0-llvmpipe-shmget.patch
 #Patch11: mesa-8.0-nouveau-tfp-blacklist.patch
 Patch12: mesa-8.0.1-fix-16bpp.patch
 Patch14: i965-hack-hiz-snb-fix.patch
-
+Patch15: 0001-llvmpipe-Work-without-sse2-if-llvm-is-new-enough.patch
 
 BuildRequires: pkgconfig autoconf automake libtool
 %if %{with_hardware}
@@ -301,6 +301,7 @@ Mesa shared glapi
 
 # hack from chromium - awaiting real upstream fix
 %patch14 -p1 -b .snbfix
+%patch15 -p1 -b .sse2
 # default to dri (not xlib) for libGL on all arches
 # XXX please fix upstream
 sed -i 's/^default_driver.*$/default_driver="dri"/' configure.ac
@@ -591,6 +592,9 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 
 %changelog
+* Thu Apr 04 2013 Adam Jackson <ajax at redhat.com> 9.1-5
+- Enable llvmpipe even on non-SSE2 machines (#909473)
+
 * Tue Mar 26 2013 Adam Jackson <ajax at redhat.com> 9.1-4
 - Fix build with private LLVM
 


More information about the scm-commits mailing list