aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-10-02 04:39:22 +0100
committerEric Anholt <eric@anholt.net>2009-10-02 13:21:23 -0700
commit04495eeec2f053be17a10cc82e646a1e23ed3830 (patch)
treeb4d4ff65046b0cba5712ed07f0deb0b7e6b6133e /configure.ac
parent0fb215ae3199b5be0c9a9474e5941f8d8998c11a (diff)
intel: Use atomic refcounters
As the target architecture for Intel GPUs is the x86, we can presume to have reasonable compiler support for Intel atomic intrinsics, i.e. gcc, and so use those in preference to pulling in a complicated mess of fragile assembly. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> [anholt: hand-resolved against my previous commit. This brings cairo-gl firefox-talos-gfx time from 65 seconds back down to 62 seconds.] Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac17
1 files changed, 17 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index d7070529..2852962e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -146,6 +146,23 @@ if test "x$HAVE_LIBUDEV" = xyes; then
fi
AM_CONDITIONAL(HAVE_LIBUDEV, [test "x$HAVE_LIBUDEV" = xyes])
+# Check for atomic intrinsics
+AC_CACHE_CHECK([for native atomic primitives], drm_cv_atomic_primitives,
+[
+ drm_cv_atomic_primitives="none"
+
+ AC_TRY_LINK([
+int atomic_add(int i) { return __sync_fetch_and_add (&i, 1); }
+int atomic_cmpxchg(int i, int j, int k) { return __sync_val_compare_and_swap (&i, j, k); }
+], [],
+ drm_cv_atomic_primitives="Intel"
+ )
+])
+if test "x$drm_cv_atomic_primitives" = xIntel; then
+ AC_DEFINE(HAVE_INTEL_ATOMIC_PRIMITIVES, 1,
+ [Enable if your compiler supports the Intel __sync_* atomic primitives])
+fi
+
AC_SUBST(WARN_CFLAGS)
AC_OUTPUT([
Makefile