[igt-dev] [PATCH i-g-t v3 07/11] tests/gem_eio: use igt_cork

Antonio Argenziano antonio.argenziano at intel.com
Fri Feb 16 00:43:06 UTC 2018


With igt_cork added as common utility we can use it instead of the
local copy

Signed-off-by: Antonio Argenziano <antonio.argenziano at intel.com>

Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
---
 tests/gem_eio.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/tests/gem_eio.c b/tests/gem_eio.c
index 16a89ecd..92d910c4 100644
--- a/tests/gem_eio.c
+++ b/tests/gem_eio.c
@@ -338,13 +338,12 @@ static void test_inflight_external(int fd)
 	struct drm_i915_gem_exec_object2 obj;
 	uint32_t bbe = MI_BATCH_BUFFER_END;
 	igt_hang_t hang;
-	int timeline, fence;
+	uint32_t fence;
+	struct igt_cork_sw_sync cork;
 
-	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(fd, SW_SYNC, &cork);
 
 	igt_require(i915_reset_control(false));
 	hang = igt_hang_ring(fd, I915_EXEC_DEFAULT);
@@ -366,7 +365,7 @@ static void test_inflight_external(int fd)
 	igt_assert(fence != -1);
 
 	igt_post_hang_ring(fd, hang); /* wedged, with an unready batch */
-	sw_sync_timeline_inc(timeline, 1); /* only now submit our batches */
+	igt_cork_unplug(SW_SYNC, &cork); /* only now submit our batches */
 
 	igt_assert_eq(__gem_wait(fd, obj.handle, -1), 0);
 	igt_assert_eq(sync_fence_status(fence), -EIO);
@@ -374,7 +373,6 @@ static void test_inflight_external(int fd)
 
 	igt_assert(i915_reset_control(true));
 	trigger_reset(fd);
-	close(timeline);
 }
 
 static void test_inflight_internal(int fd)
-- 
2.14.2



More information about the igt-dev mailing list