public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] i915/gem_ctx_persistence: Sanitycheck execbuf state harder for 'queued'
@ 2019-10-30 23:59 Chris Wilson
  2019-10-31  0:42 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
  2019-11-01  5:13 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2019-10-30 23:59 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

And initialise fence to -1 to avoid closing stdin (fd:0)!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_ctx_persistence.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/i915/gem_ctx_persistence.c b/tests/i915/gem_ctx_persistence.c
index 9273da159..fa6ee7516 100644
--- a/tests/i915/gem_ctx_persistence.c
+++ b/tests/i915/gem_ctx_persistence.c
@@ -363,10 +363,10 @@ static void test_nonpersistent_file(int i915)
 
 static void test_nonpersistent_queued(int i915, unsigned int engine)
 {
-	int count = gem_measure_ring_inflight(i915, engine, 0);
+	const int count = gem_measure_ring_inflight(i915, engine, 0);
 	igt_spin_t *spin;
+	int fence = -1;
 	uint32_t ctx;
-	int fence;
 
 	/*
 	 * Not only must the immediate batch be cancelled, but
@@ -383,10 +383,13 @@ static void test_nonpersistent_queued(int i915, unsigned int engine)
 			    .flags = IGT_SPIN_FENCE_OUT);
 
 	for (int i = 0; i < count - 1; i++) {
+		spin->execbuf.rsvd2 = 0;
 		if (fence != -1)
 			close(fence);
-		spin->execbuf.rsvd2 = 0;
+
+		igt_assert(spin->execbuf.flags & I915_EXEC_FENCE_OUT);
 		gem_execbuf_wr(i915, &spin->execbuf);
+
 		igt_assert(spin->execbuf.rsvd2);
 		fence = spin->execbuf.rsvd2 >> 32;
 	}
@@ -396,8 +399,7 @@ static void test_nonpersistent_queued(int i915, unsigned int engine)
 	igt_assert_eq(sync_fence_wait(fence, MSEC_PER_SEC / 5), 0);
 	igt_assert_eq(sync_fence_status(fence), -EIO);
 
-	spin->handle = 0;
-	igt_spin_free(-1, spin);
+	igt_spin_free(i915, spin);
 }
 
 static void sendfd(int socket, int fd)
-- 
2.24.0.rc1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-01  5:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-30 23:59 [igt-dev] [PATCH i-g-t] i915/gem_ctx_persistence: Sanitycheck execbuf state harder for 'queued' Chris Wilson
2019-10-31  0:42 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-11-01  5:13 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox