diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-05-29 16:14:31 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-05-29 16:14:31 +0200 |
commit | f14a045137ea804625439fc7ac3144e46a12d3ae (patch) | |
tree | 29756e1b7b2c8006c6fec4b4a057cd200d5a9348 | |
parent | 9cfcb75b79829230dc9dde1247a82ffe8b0b9702 (diff) |
tests/gem_wait_rendering_timeout: make it compile
... we need to do this libdrm depency dance. Or just copy&paste it.
-rw-r--r-- | tests/gem_wait_render_timeout.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/gem_wait_render_timeout.c b/tests/gem_wait_render_timeout.c index 8edfc43..6ed3144 100644 --- a/tests/gem_wait_render_timeout.c +++ b/tests/gem_wait_render_timeout.c @@ -52,6 +52,36 @@ do_time_diff(struct timespec *end, struct timespec *start) return ret; } +/* to avoid stupid depencies on libdrm, copy&paste */ +struct local_drm_i915_gem_wait { + /** Handle of BO we shall wait on */ + __u32 bo_handle; + __u32 flags; + /** Number of nanoseconds to wait, Returns time remaining. */ + __u64 timeout_ns; +}; + +# define WAIT_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x2c, struct local_drm_i915_gem_wait) + +static int +gem_bo_wait_timeout(int fd, uint32_t handle, uint64_t *timeout_ns) +{ + struct local_drm_i915_gem_wait wait; + int ret; + + assert(timeout_ns); + + wait.bo_handle = handle; + wait.timeout_ns = *timeout_ns; + wait.flags = 0; + ret = drmIoctl(fd, WAIT_IOCTL, &wait); + if (ret) + return ret; + + *timeout_ns = wait.timeout_ns; + + return ret; +} static void blt_color_fill(struct intel_batchbuffer *batch, drm_intel_bo *buf, @@ -128,7 +158,7 @@ int main(int argc, char **argv) intel_batchbuffer_flush(batch); - ret = drm_intel_gem_bo_wait(dst2, &timeout); + ret = gem_bo_wait_timeout(fd, dst2->handle, &timeout); if (do_signals) drmtest_stop_signal_helper(); if (ret) { |