drmIoctl doesn't return the errno, so look it up after an error.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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 |
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);
}