xf86-video-intel: configure.ac test/lowlevel-blt-bench.c test/Makefile.am

Chris Wilson ickle at kemper.freedesktop.org
Sun Aug 17 23:44:32 PDT 2014


 configure.ac              |    1 +
 test/Makefile.am          |    5 +----
 test/lowlevel-blt-bench.c |    9 ++++++++-
 3 files changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 02f184e0ef428d9d80fecbaa438a7cbd87c18a91
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Aug 18 07:43:21 2014 +0100

    test: Make SHM tests in lowlevel-blt-bench optional
    
    A slightly more complex patch to disable the SHM based tests of
    lowlevel-blt-bench when MIT-SHM support is not available at compile
    time.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/configure.ac b/configure.ac
index 797e224..9146d07 100644
--- a/configure.ac
+++ b/configure.ac
@@ -246,6 +246,7 @@ if test "x$shm" = "xyes"; then
 		  AC_MSG_RESULT(yes),
 		  AC_MSG_RESULT(no),
 		  AC_MSG_RESULT(assuming no))
+	AC_DEFINE([HAVE_MIT_SHM], 1, [Define to 1 if MIT-SHM is available])
 fi
 
 PKG_CHECK_MODULES(X11_DRI3, [xcb-dri3 xcb-sync xcb-present x11-xcb xshmfence x11 xrender xext libdrm], [x11_dri3="yes"], [x11_dri3="no"])
diff --git a/test/Makefile.am b/test/Makefile.am
index be0b1f0..f9906d4 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -40,10 +40,7 @@ stress_TESTS += \
 endif
 check_PROGRAMS = $(stress_TESTS)
 
-noinst_PROGRAMS =
-if X11_SHM
-noinst_PROGRAMS += lowlevel-blt-bench
-endif
+noinst_PROGRAMS = lowlevel-blt-bench
 
 AM_CFLAGS = @CWARNFLAGS@ $(X11_CFLAGS) $(DRM_CFLAGS)
 LDADD = libtest.la $(X11_LIBS) $(DRM_LIBS) $(CLOCK_GETTIME_LIBS)
diff --git a/test/lowlevel-blt-bench.c b/test/lowlevel-blt-bench.c
index c54fbd5..9eef8db 100644
--- a/test/lowlevel-blt-bench.c
+++ b/test/lowlevel-blt-bench.c
@@ -37,6 +37,7 @@
 #include <X11/Xutil.h> /* for XDestroyImage */
 #include <X11/Xlibint.h>
 #include <X11/extensions/Xrender.h>
+#if HAVE_MIT_SHM
 #include <X11/extensions/XShm.h>
 #if HAVE_X11_EXTENSIONS_SHMPROTO_H
 #include <X11/extensions/shmproto.h>
@@ -45,9 +46,10 @@
 #else
 #error Failed to find the right header for X11 MIT-SHM protocol definitions
 #endif
-#include <pixman.h> /* for pixman blt functions */
 #include <sys/ipc.h>
 #include <sys/shm.h>
+#endif
+#include <pixman.h> /* for pixman blt functions */
 
 #include "test.h"
 
@@ -228,6 +230,7 @@ static Picture source_radial_generic(struct test_display *t, struct test_target
 	return XRenderCreateRadialGradient(t->dpy, &gradient, stops, colors, 2);
 }
 
+#if HAVE_MIT_SHM
 static XShmSegmentInfo shmref, shmout;
 
 static void setup_shm(struct test *t)
@@ -290,6 +293,10 @@ static Picture source_shm(struct test_display *t, struct test_target *target)
 
 	return picture;
 }
+#else
+static void setup_shm(struct test *t) { }
+static Picture source_shm(struct test_display *t, struct test_target *target) { return 0; }
+#endif
 
 static const struct {
 	Picture (*create)(struct test_display *, struct test_target *);


More information about the xorg-commit mailing list