summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-06-05 14:01:40 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-06-09 14:56:26 +0100
commit43baec15f4d2a97fc55ca4aeb70d20ce4b292c9a (patch)
treed95453bcf58fb5054c153220446db5a40bb4727a /benchmarks
parentd492abfbad687d3c5f343b836da4c7316a57ba77 (diff)
benchmarks/gem_busy: Trim unused compares
Keep userspace light and don't spend time testing the result if we don't use it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/gem_busy.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/benchmarks/gem_busy.c b/benchmarks/gem_busy.c
index c1cee6c0..f050454b 100644
--- a/benchmarks/gem_busy.c
+++ b/benchmarks/gem_busy.c
@@ -59,31 +59,16 @@
#define WAIT 0x8
#define SYNC 0x10
-static bool gem_busy(int fd, uint32_t handle)
+static void gem_busy(int fd, uint32_t handle)
{
- struct drm_i915_gem_busy busy;
-
- memset(&busy, 0, sizeof(busy));
- busy.handle = handle;
-
- do_ioctl(fd, DRM_IOCTL_I915_GEM_BUSY, &busy);
-
- return busy.busy != 0;
+ struct drm_i915_gem_busy busy = { .handle = handle };
+ ioctl(fd, DRM_IOCTL_I915_GEM_BUSY, &busy);
}
-static bool gem_wait__busy(int fd, uint32_t handle)
+static void gem_wait__busy(int fd, uint32_t handle)
{
- struct drm_i915_gem_wait wait;
- int ret;
-
- memset(&wait, 0, sizeof(wait));
- wait.bo_handle = handle;
-
- ret = 0;
- if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_WAIT, &wait))
- ret = -errno;
-
- return ret == -ETIME;
+ struct drm_i915_gem_wait wait = { .bo_handle = handle };
+ ioctl(fd, DRM_IOCTL_I915_GEM_WAIT, &wait);
}
static double elapsed(const struct timespec *start,