diff options
Diffstat (limited to 'tests/prime_vgem.c')
-rw-r--r-- | tests/prime_vgem.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c index 763c62e6..d886044a 100644 --- a/tests/prime_vgem.c +++ b/tests/prime_vgem.c @@ -24,6 +24,7 @@ #include "igt.h" #include "igt_vgem.h" +#include <sys/ioctl.h> #include <sys/poll.h> #include <signal.h> #include <time.h> @@ -236,6 +237,18 @@ static void test_gtt(int vgem, int i915) gem_close(vgem, scratch.handle); } +static bool is_coherent(int i915) +{ + int val = 1; /* by default, we assume GTT is coherent, hence the test */ + struct drm_i915_getparam gp = { + gp.param = 52, /* GTT_COHERENT */ + gp.value = &val, + }; + + ioctl(i915, DRM_IOCTL_I915_GETPARAM, &gp); + return val; +} + static void test_gtt_interleaved(int vgem, int i915) { struct vgem_bo scratch; @@ -243,6 +256,8 @@ static void test_gtt_interleaved(int vgem, int i915) uint32_t *ptr, *gtt; int dmabuf, i; + igt_require(is_coherent(i915)); + scratch.width = 1024; scratch.height = 1024; scratch.bpp = 32; |