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@chris-wilson.co.uk>
This commit is contained in:
parent
9058dac302
commit
02f184e0ef
|
|
@ -246,6 +246,7 @@ if test "x$shm" = "xyes"; then
|
||||||
AC_MSG_RESULT(yes),
|
AC_MSG_RESULT(yes),
|
||||||
AC_MSG_RESULT(no),
|
AC_MSG_RESULT(no),
|
||||||
AC_MSG_RESULT(assuming no))
|
AC_MSG_RESULT(assuming no))
|
||||||
|
AC_DEFINE([HAVE_MIT_SHM], 1, [Define to 1 if MIT-SHM is available])
|
||||||
fi
|
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"])
|
PKG_CHECK_MODULES(X11_DRI3, [xcb-dri3 xcb-sync xcb-present x11-xcb xshmfence x11 xrender xext libdrm], [x11_dri3="yes"], [x11_dri3="no"])
|
||||||
|
|
|
||||||
|
|
@ -40,10 +40,7 @@ stress_TESTS += \
|
||||||
endif
|
endif
|
||||||
check_PROGRAMS = $(stress_TESTS)
|
check_PROGRAMS = $(stress_TESTS)
|
||||||
|
|
||||||
noinst_PROGRAMS =
|
noinst_PROGRAMS = lowlevel-blt-bench
|
||||||
if X11_SHM
|
|
||||||
noinst_PROGRAMS += lowlevel-blt-bench
|
|
||||||
endif
|
|
||||||
|
|
||||||
AM_CFLAGS = @CWARNFLAGS@ $(X11_CFLAGS) $(DRM_CFLAGS)
|
AM_CFLAGS = @CWARNFLAGS@ $(X11_CFLAGS) $(DRM_CFLAGS)
|
||||||
LDADD = libtest.la $(X11_LIBS) $(DRM_LIBS) $(CLOCK_GETTIME_LIBS)
|
LDADD = libtest.la $(X11_LIBS) $(DRM_LIBS) $(CLOCK_GETTIME_LIBS)
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
#include <X11/Xutil.h> /* for XDestroyImage */
|
#include <X11/Xutil.h> /* for XDestroyImage */
|
||||||
#include <X11/Xlibint.h>
|
#include <X11/Xlibint.h>
|
||||||
#include <X11/extensions/Xrender.h>
|
#include <X11/extensions/Xrender.h>
|
||||||
|
#if HAVE_MIT_SHM
|
||||||
#include <X11/extensions/XShm.h>
|
#include <X11/extensions/XShm.h>
|
||||||
#if HAVE_X11_EXTENSIONS_SHMPROTO_H
|
#if HAVE_X11_EXTENSIONS_SHMPROTO_H
|
||||||
#include <X11/extensions/shmproto.h>
|
#include <X11/extensions/shmproto.h>
|
||||||
|
|
@ -45,9 +46,10 @@
|
||||||
#else
|
#else
|
||||||
#error Failed to find the right header for X11 MIT-SHM protocol definitions
|
#error Failed to find the right header for X11 MIT-SHM protocol definitions
|
||||||
#endif
|
#endif
|
||||||
#include <pixman.h> /* for pixman blt functions */
|
|
||||||
#include <sys/ipc.h>
|
#include <sys/ipc.h>
|
||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
|
#endif
|
||||||
|
#include <pixman.h> /* for pixman blt functions */
|
||||||
|
|
||||||
#include "test.h"
|
#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);
|
return XRenderCreateRadialGradient(t->dpy, &gradient, stops, colors, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if HAVE_MIT_SHM
|
||||||
static XShmSegmentInfo shmref, shmout;
|
static XShmSegmentInfo shmref, shmout;
|
||||||
|
|
||||||
static void setup_shm(struct test *t)
|
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;
|
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 {
|
static const struct {
|
||||||
Picture (*create)(struct test_display *, struct test_target *);
|
Picture (*create)(struct test_display *, struct test_target *);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue