summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-14 17:41:34 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-14 17:43:04 +0000
commitf381a8b9f08a6d0c843e7b9f7997020d6b0d1e1a (patch)
tree5c90eaf860d165fb7625e7a2c3a93f5425c30b7c /tests
parent2a292188e764c18b76698e1698ecaf62699b2f04 (diff)
tests/gem_exec_blt: silence the compiler by failing on error
gem_exec_blt.c: In function ‘gem_exec’: gem_exec_blt.c:174:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Propagate the failure and exit(1).
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_exec_blt.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/gem_exec_blt.c b/tests/gem_exec_blt.c
index 19eb7167..b2ca2d67 100644
--- a/tests/gem_exec_blt.c
+++ b/tests/gem_exec_blt.c
@@ -169,15 +169,17 @@ static void gem_sync(int fd, uint32_t handle)
drmIoctl(fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain);
}
-static void gem_exec(int fd, struct drm_i915_gem_execbuffer2 *execbuf, int loops)
+static int gem_exec(int fd, struct drm_i915_gem_execbuffer2 *execbuf, int loops)
{
- int ret;
+ int ret = 0;
- while (loops--) {
+ while (loops-- && ret == 0) {
ret = drmIoctl(fd,
DRM_IOCTL_I915_GEM_EXECBUFFER2,
execbuf);
}
+
+ return ret;
}
static double elapsed(const struct timeval *start,
@@ -272,7 +274,8 @@ static void run(int object_size)
struct timeval start, end;
gettimeofday(&start, NULL);
- gem_exec(fd, &execbuf, count);
+ if (gem_exec(fd, &execbuf, count))
+ exit(1);
gem_sync(fd, handle);
gettimeofday(&end, NULL);
printf("Time to blt %d bytes x %6d: %7.3fµs, %s\n",