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

This commit is contained in:
Adam Jackson 2013-04-04 17:23:59 -04:00
parent 5b216c73c9
commit ac0fbf9e29
2 changed files with 39 additions and 2 deletions

View File

@ -0,0 +1,33 @@
From a499fd73461257f284bd3194f9198dc484acd373 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@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@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

View File

@ -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@redhat.com> 9.1-5
- Enable llvmpipe even on non-SSE2 machines (#909473)
* Tue Mar 26 2013 Adam Jackson <ajax@redhat.com> 9.1-4
- Fix build with private LLVM