From cf72da57dcc1baeaaff71250a82b40ab324b7590 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Sun, 22 Apr 2012 12:35:23 +0200 Subject: tests: add gem_unfence_active_buffers Unfortunately this requires slab poisoning to catch anything :( Also add a new helper to drmtest to get the available fence count. Signed-off-by: Daniel Vetter --- lib/drmtest.c | 15 +++++++++++++++ lib/drmtest.h | 1 + 2 files changed, 16 insertions(+) (limited to 'lib') diff --git a/lib/drmtest.c b/lib/drmtest.c index ebc396f0..fc2f1a81 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -73,6 +73,21 @@ bool gem_uses_aliasing_ppgtt(int fd) return val; } +int gem_available_fences(int fd) +{ + struct drm_i915_getparam gp; + int val; + + gp.param = I915_PARAM_NUM_FENCES_AVAIL; + gp.value = &val; + + if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp))) + return 0; + + return val; +} + + /* Ensure the gpu is idle by launching a nop execbuf and stalling for it. */ void gem_quiescent_gpu(int fd) { diff --git a/lib/drmtest.h b/lib/drmtest.h index f4462a23..b0940f3a 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -57,6 +57,7 @@ int gem_madvise(int fd, uint32_t handle, int state); /* feature test helpers */ bool gem_uses_aliasing_ppgtt(int fd); +int gem_available_fences(int fd); /* generally useful helpers */ void drmtest_fork_signal_helper(void); -- cgit v1.2.3