From 43baec15f4d2a97fc55ca4aeb70d20ce4b292c9a Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 5 Jun 2017 14:01:40 +0100 Subject: 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 --- benchmarks/gem_busy.c | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'benchmarks') 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, -- cgit v1.2.3