[PATCH igt] igt/syncobj_wait: Avoid early close of timeline in test_wait_snapshot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We want to keep the first timeline in an incomplete state as we replace
the syncobj's fence; so we need to defer the close() until the end of
the test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103188
Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Jason Ekstrand <jason@xxxxxxxxxxxxxx>
Cc: Dave Airlie <airlied@xxxxxxxxxx>
---
 tests/syncobj_wait.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/syncobj_wait.c b/tests/syncobj_wait.c
index 5fd37808..2d5328cc 100644
--- a/tests/syncobj_wait.c
+++ b/tests/syncobj_wait.c
@@ -525,7 +525,7 @@ test_wait_snapshot(int fd, uint32_t test_flags)
 {
 	struct wait_thread_data wait = { 0 };
 	uint32_t syncobjs[2];
-	int timelines[2] = { -1, -1 };
+	int timelines[3] = { -1, -1, -1 };
 	pthread_t thread;
 
 	syncobjs[0] = syncobj_create(fd, 0);
@@ -570,7 +570,7 @@ test_wait_snapshot(int fd, uint32_t test_flags)
 	 * the kernel picks up on the new fence (it shouldn't), we'll get a
 	 * timeout.
 	 */
-	close(timelines[0]);
+	timelines[2] = timelines[0];
 	timelines[0] = syncobj_attach_sw_sync(fd, syncobjs[0]);
 
 	sleep_nsec(SHORT_TIME_NSEC / 5);
@@ -589,6 +589,7 @@ test_wait_snapshot(int fd, uint32_t test_flags)
 
 	close(timelines[0]);
 	close(timelines[1]);
+	close(timelines[2]);
 	syncobj_destroy(fd, syncobjs[0]);
 	syncobj_destroy(fd, syncobjs[1]);
 }
-- 
2.15.0.rc0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux