Mesa (master): gallivm: Centralize the cpu caps detection.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Sat Apr 24 15:14:09 UTC 2010


Module: Mesa
Branch: master
Commit: e7a8cfc8776c70f8c4cc3e158f663f6c630169ed
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e7a8cfc8776c70f8c4cc3e158f663f6c630169ed

Author: José Fonseca <jfonseca at vmware.com>
Date:   Sat Apr 24 13:19:10 2010 +0100

gallivm: Centralize the cpu caps detection.

---

 src/gallium/auxiliary/gallivm/lp_bld_init.c |   10 ++++++++++
 src/gallium/drivers/llvmpipe/lp_jit.c       |    9 ---------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
index de07c22..5067d0a 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
@@ -27,6 +27,7 @@
 
 
 #include "pipe/p_compiler.h"
+#include "util/u_cpu_detect.h"
 #include "util/u_debug.h"
 #include "lp_bld_init.h"
 
@@ -62,6 +63,15 @@ lp_build_init(void)
 
    if (!lp_build_target)
       lp_build_target = LLVMGetExecutionEngineTargetData(lp_build_engine);
+
+   util_cpu_detect();
+
+#if 0
+   /* For simulating less capable machines */
+   util_cpu_caps.has_sse3 = 0;
+   util_cpu_caps.has_ssse3 = 0;
+   util_cpu_caps.has_sse4_1 = 0;
+#endif
 }
 
 
diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c
index 8690941..466a2f5 100644
--- a/src/gallium/drivers/llvmpipe/lp_jit.c
+++ b/src/gallium/drivers/llvmpipe/lp_jit.c
@@ -171,15 +171,6 @@ lp_jit_screen_cleanup(struct llvmpipe_screen *screen)
 void
 lp_jit_screen_init(struct llvmpipe_screen *screen)
 {
-   util_cpu_detect();
-
-#if 0
-   /* For simulating less capable machines */
-   util_cpu_caps.has_sse3 = 0;
-   util_cpu_caps.has_ssse3 = 0;
-   util_cpu_caps.has_sse4_1 = 0;
-#endif
-
    lp_build_init();
 
    screen->module = lp_build_module;




More information about the mesa-commit mailing list