[PATCH i-g-t v11 15/21] tests/sw_sync: Add subtest test_timeline_closed

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

 



This subtest verifies that the fences of a timeline are not signalled when
a timelne is closed.

Signed-off-by: Robert Foss <robert.foss@xxxxxxxxxxxxx>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@xxxxxxxxxxxxx>
---
 tests/sw_sync.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/tests/sw_sync.c b/tests/sw_sync.c
index e88ecde4..26bdd210 100644
--- a/tests/sw_sync.c
+++ b/tests/sw_sync.c
@@ -71,6 +71,20 @@ static void test_alloc_fence_invalid_timeline(void)
 	    "Did not fail to create fence on invalid timeline\n");
 }
 
+static void test_timeline_closed(void)
+{
+	int fence, ret;
+	int timeline;
+
+	timeline = sw_sync_timeline_create();
+	fence = sw_sync_fence_create(timeline, 1);
+
+	close(timeline);
+	ret = sync_wait(fence, 0);
+	igt_assert_f(ret == -1 && errno == ETIME,
+        "Failure waiting on unsignaled fence on closed timeline\n");
+}
+
 static void test_alloc_merge_fence(void)
 {
 	int in_fence[2];
@@ -702,6 +716,9 @@ igt_main
 	igt_subtest("alloc_fence_invalid_timeline")
 		test_alloc_fence_invalid_timeline();
 
+	igt_subtest("timeline_closed")
+		test_timeline_closed();
+
 	igt_subtest("alloc_merge_fence")
 		test_alloc_merge_fence();
 
-- 
2.11.0

_______________________________________________
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