summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/gem_fence_thrash.c8
-rw-r--r--tests/gem_fenced_exec_thrash.c8
-rw-r--r--tests/gem_stress.c8
3 files changed, 6 insertions, 18 deletions
diff --git a/tests/gem_fence_thrash.c b/tests/gem_fence_thrash.c
index 01fd0f6e..e1cfc4e1 100644
--- a/tests/gem_fence_thrash.c
+++ b/tests/gem_fence_thrash.c
@@ -169,19 +169,15 @@ static int run_test(int threads_per_fence, void *f, int tiling,
int surfaces_per_thread)
{
struct test t;
- drm_i915_getparam_t gp;
pthread_t *threads;
int n, num_fences, num_threads;
- int ret;
t.fd = drm_open_any();
t.tiling = tiling;
t.num_surfaces = surfaces_per_thread;
- gp.param = I915_PARAM_NUM_FENCES_AVAIL;
- gp.value = &num_fences;
- ret = ioctl(t.fd, DRM_IOCTL_I915_GETPARAM, &gp);
- assert (ret == 0);
+ num_fences = gem_available_fences(t.fd);
+ assert (num_fences > 0);
num_threads = threads_per_fence * num_fences;
diff --git a/tests/gem_fenced_exec_thrash.c b/tests/gem_fenced_exec_thrash.c
index b17eba20..ca88c532 100644
--- a/tests/gem_fenced_exec_thrash.c
+++ b/tests/gem_fenced_exec_thrash.c
@@ -88,13 +88,9 @@ batch_create (int fd)
static int get_num_fences(int fd)
{
- drm_i915_getparam_t gp;
- int ret, val;
+ int val;
- gp.param = I915_PARAM_NUM_FENCES_AVAIL;
- gp.value = &val;
- ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
- assert (ret == 0);
+ val = gem_available_fences(fd);
printf ("total %d fences\n", val);
assert(val > 4);
diff --git a/tests/gem_stress.c b/tests/gem_stress.c
index 54597afe..9b31a690 100644
--- a/tests/gem_stress.c
+++ b/tests/gem_stress.c
@@ -605,13 +605,9 @@ static void copy_tiles(unsigned *permutation)
static int get_num_fences(void)
{
- drm_i915_getparam_t gp;
- int ret, val;
+ int val;
- gp.param = I915_PARAM_NUM_FENCES_AVAIL;
- gp.value = &val;
- ret = drmIoctl(drm_fd, DRM_IOCTL_I915_GETPARAM, &gp);
- assert (ret == 0);
+ val = gem_available_fences(drm_fd);
printf ("total %d fences\n", val);
assert(val > 4);