[Intel-gfx] [PATCH i-g-t 15/15] tests/kms_psr_sink_crc: Add own loop.

Rodrigo Vivi rodrigo.vivi at intel.com
Mon Jan 12 10:22:07 PST 2015


Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
---
 tests/kms_psr_sink_crc.c | 119 ++++++++++++++++++++++++-----------------------
 1 file changed, 61 insertions(+), 58 deletions(-)

diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index 9616b4c..741c45d 100644
--- a/tests/kms_psr_sink_crc.c
+++ b/tests/kms_psr_sink_crc.c
@@ -585,86 +585,89 @@ int main(int argc, char *argv[])
 		display_init(&data);
 	}
 
-	for (op = PAGE_FLIP; op <= RENDER; op++) {
-		igt_subtest_f("primary_%s", op_str(op)) {
+	do {
+		for (op = PAGE_FLIP; op <= RENDER; op++) {
+			igt_subtest_f("primary_%s", op_str(op)) {
+				data.test_plane = PRIMARY;
+				data.op = op;
+				setup_test_plane(&data);
+				igt_assert(wait_psr_entry(&data));
+				run_test(&data);
+				test_cleanup(&data);
+			}
+		}
+
+		for (op = MMAP_GTT; op <= PLANE_ONOFF; op++) {
+			igt_subtest_f("sprite_%s", op_str(op)) {
+				data.test_plane = SPRITE;
+				data.op = op;
+				setup_test_plane(&data);
+				igt_assert(wait_psr_entry(&data));
+				run_test(&data);
+				test_cleanup(&data);
+			}
+		}
+
+		for (op = MMAP_GTT; op <= PLANE_ONOFF; op++) {
+			igt_subtest_f("cursor_%s", op_str(op)) {
+				data.test_plane = CURSOR;
+				data.op = op;
+				setup_test_plane(&data);
+				igt_assert(wait_psr_entry(&data));
+				run_test(&data);
+				test_cleanup(&data);
+			}
+		}
+
+		igt_subtest_f("suspend_psr_active") {
 			data.test_plane = PRIMARY;
-			data.op = op;
+			data.op = RENDER;
 			setup_test_plane(&data);
 			igt_assert(wait_psr_entry(&data));
+
+			igt_system_suspend_autoresume();
+
 			run_test(&data);
 			test_cleanup(&data);
 		}
-	}
 
-	for (op = MMAP_GTT; op <= PLANE_ONOFF; op++) {
-		igt_subtest_f("sprite_%s", op_str(op)) {
-			data.test_plane = SPRITE;
-			data.op = op;
+		igt_subtest_f("suspend_psr_exit") {
+			data.test_plane = CURSOR;
+			data.op = PLANE_MOVE;
 			setup_test_plane(&data);
+
+			igt_system_suspend_autoresume();
+
 			igt_assert(wait_psr_entry(&data));
 			run_test(&data);
 			test_cleanup(&data);
 		}
-	}
 
-	for (op = MMAP_GTT; op <= PLANE_ONOFF; op++) {
-		igt_subtest_f("cursor_%s", op_str(op)) {
-			data.test_plane = CURSOR;
-			data.op = op;
+		igt_subtest_f("dpms_off_psr_active") {
+			data.test_plane = PRIMARY;
+			data.op = RENDER;
 			setup_test_plane(&data);
 			igt_assert(wait_psr_entry(&data));
+
+			dpms_off_on(data);
+
 			run_test(&data);
 			test_cleanup(&data);
 		}
-	}
 
-	igt_subtest_f("suspend_psr_active") {
-		data.test_plane = PRIMARY;
-		data.op = RENDER;
-		setup_test_plane(&data);
-		igt_assert(wait_psr_entry(&data));
-
-		igt_system_suspend_autoresume();
-
-		run_test(&data);
-		test_cleanup(&data);
-	}
-
-	igt_subtest_f("suspend_psr_exit") {
-		data.test_plane = CURSOR;
-		data.op = PLANE_MOVE;
-		setup_test_plane(&data);
-
-		igt_system_suspend_autoresume();
-
-		igt_assert(wait_psr_entry(&data));
-		run_test(&data);
-		test_cleanup(&data);
-	}
-
-	igt_subtest_f("dpms_off_psr_active") {
-		data.test_plane = PRIMARY;
-		data.op = RENDER;
-		setup_test_plane(&data);
-		igt_assert(wait_psr_entry(&data));
-
-		dpms_off_on(data);
-
-		run_test(&data);
-		test_cleanup(&data);
-	}
+		igt_subtest_f("dpms_off_psr_exit") {
+			data.test_plane = SPRITE;
+			data.op = PLANE_ONOFF;
+			setup_test_plane(&data);
 
-	igt_subtest_f("dpms_off_psr_exit") {
-		data.test_plane = SPRITE;
-		data.op = PLANE_ONOFF;
-		setup_test_plane(&data);
+			dpms_off_on(data);
 
-		dpms_off_on(data);
+			igt_assert(wait_psr_entry(&data));
+			run_test(&data);
+			test_cleanup(&data);
+		}
 
-		igt_assert(wait_psr_entry(&data));
-		run_test(&data);
-		test_cleanup(&data);
-	}
+	} while (igt_loop == -1 || --igt_loop);
 
 	igt_fixture {
 		drm_intel_bufmgr_destroy(data.bufmgr);
-- 
2.1.0



More information about the Intel-gfx mailing list