summaryrefslogtreecommitdiff
path: root/tests/modetest
diff options
context:
space:
mode:
Diffstat (limited to 'tests/modetest')
-rw-r--r--tests/modetest/modetest.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index 48178b99..34d40ca9 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -51,6 +51,7 @@
#include "xf86drm.h"
#include "xf86drmMode.h"
#include "intel_bufmgr.h"
+#include "i915_drm.h"
#ifdef HAVE_CAIRO
#include <math.h>
@@ -661,6 +662,23 @@ void usage(char *name)
#define dump_resource(res) if (res) dump_##res()
+static int page_flipping_supported(int fd)
+{
+ int ret, value;
+ struct drm_i915_getparam gp;
+
+ gp.param = I915_PARAM_HAS_PAGEFLIPPING;
+ gp.value = &value;
+
+ ret = drmCommandWriteRead(fd, DRM_I915_GETPARAM, &gp, sizeof(gp));
+ if (ret) {
+ fprintf(stderr, "drm_i915_getparam: %m\n");
+ return 0;
+ }
+
+ return gp.value;
+}
+
int main(int argc, char **argv)
{
int c;
@@ -725,6 +743,11 @@ int main(int argc, char **argv)
}
}
+ if (test_vsync && !page_flipping_supported(fd)) {
+ fprintf(stderr, "page flipping not supported by drm.\n");
+ return -1;
+ }
+
if (i == ARRAY_SIZE(modules)) {
fprintf(stderr, "failed to load any modules, aborting.\n");
return -1;