summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-20 12:40:56 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-20 12:40:56 +0100
commit398be7d573fc20c42c737fdac3e3e979835c47fa (patch)
treec05d431cefed5a2d63d727efce3231a1b7a6a032 /tests
parentc615b5828974bd5f182b5ee35c5ed3393b3fe2b5 (diff)
gem_evict_everything: Fix the error code checking after drmIoctl
drmIoctl doesn't return the errno, so look it up after an error. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_evict_everything.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/gem_evict_everything.c b/tests/gem_evict_everything.c
index 9c88a6ba..cf55939e 100644
--- a/tests/gem_evict_everything.c
+++ b/tests/gem_evict_everything.c
@@ -57,7 +57,7 @@ copy(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo, int n_bo, int error)
struct drm_i915_gem_exec_object2 *obj;
struct drm_i915_gem_execbuffer2 exec;
uint32_t handle;
- int n;
+ int n, ret;
batch[0] = (XY_SRC_COPY_BLT_CMD |
XY_SRC_COPY_BLT_WRITE_ALPHA |
@@ -109,7 +109,10 @@ copy(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo, int n_bo, int error)
i915_execbuffer2_set_context_id(exec, 0);
exec.rsvd2 = 0;
- igt_assert(drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec) == error);
+ ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
+ if (ret)
+ ret = errno;
+ igt_assert(ret == error);
gem_close(fd, handle);
}