diff options
author | Jakob Bornecrantz <jakob@vmware.com> | 2010-01-05 20:59:24 +0100 |
---|---|---|
committer | Jakob Bornecrantz <jakob@vmware.com> | 2010-01-05 20:59:24 +0100 |
commit | 2f7f7ceccab4176217c399502b3ff95df1517627 (patch) | |
tree | 1a9f6e6c8ebcf5b13d9877685fce91b87a971ed2 /tests | |
parent | d6059c3dd1300662e941ccd5e55649534fbb9a63 (diff) | |
parent | 6d3b8bbddd44b42d89adb1aafb7645e7f802673a (diff) |
Merge branch 'master' into libkms-master
Conflicts:
configure.ac
Diffstat (limited to 'tests')
-rw-r--r-- | tests/modetest/modetest.c | 23 |
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; |