summaryrefslogtreecommitdiff
path: root/lib/drmtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/drmtest.c')
-rw-r--r--lib/drmtest.c15
1 files changed, 15 insertions, 0 deletions
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)
{