summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Argenziano <antonio.argenziano@intel.com>2018-02-21 15:19:43 -0800
committerChris Wilson <chris@chris-wilson.co.uk>2018-02-23 08:57:15 +0000
commitfad98fa0e1974eb63d3f29e78ded9286ce735ffa (patch)
tree85eea9ff71b10a7b141053f9c4653588cfe376a6
parentcc1f2ed53ea2b106101b6b5c2179471b6c96e048 (diff)
tests/gem_eio: use igt_cork
With igt_cork added as common utility we can use it instead of the local copy Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--tests/gem_eio.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/gem_eio.c b/tests/gem_eio.c
index 5efcc461..249f5bff 100644
--- a/tests/gem_eio.c
+++ b/tests/gem_eio.c
@@ -365,15 +365,14 @@ static void test_inflight_external(int fd)
const uint32_t bbe = MI_BATCH_BUFFER_END;
struct drm_i915_gem_execbuffer2 execbuf;
struct drm_i915_gem_exec_object2 obj;
- int timeline, fence;
igt_spin_t *hang;
+ uint32_t fence;
+ IGT_CORK_FENCE(cork);
- igt_require_gem(fd);
igt_require_sw_sync();
igt_require(gem_has_exec_fence(fd));
- timeline = sw_sync_timeline_create();
- fence = sw_sync_timeline_create_fence(timeline, 1);
+ fence = igt_cork_plug(&cork, fd);
igt_require(i915_reset_control(false));
hang = __igt_spin_batch_new(fd, 0, 0, 0);
@@ -397,7 +396,7 @@ static void test_inflight_external(int fd)
gem_sync(fd, hang->handle); /* wedged, with an unready batch */
igt_assert(!gem_bo_busy(fd, hang->handle));
igt_assert(gem_bo_busy(fd, obj.handle));
- sw_sync_timeline_inc(timeline, 1); /* only now submit our batches */
+ igt_cork_unplug(&cork); /* only now submit our batches */
igt_assert_eq(__gem_wait(fd, obj.handle, -1), 0);
igt_assert_eq(sync_fence_status(fence), -EIO);
@@ -406,7 +405,6 @@ static void test_inflight_external(int fd)
igt_spin_batch_free(fd, hang);
igt_assert(i915_reset_control(true));
trigger_reset(fd);
- close(timeline);
}
static void test_inflight_internal(int fd)