[PATCH i-g-t v1 5/6] tests/kms_cursor_legacy: Switch to using for_each_pipe construct

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

 



Avoid using hand-rolled construct for iterating over all pipes.

Signed-off-by: Robert Foss <robert.foss@xxxxxxxxxxxxx>
---
 tests/kms_cursor_legacy.c | 31 ++++++++++++++-----------------
 1 file changed, 14 insertions(+), 17 deletions(-)

diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
index 5e9f5f39..156bd0c7 100644
--- a/tests/kms_cursor_legacy.c
+++ b/tests/kms_cursor_legacy.c
@@ -1360,6 +1360,7 @@ igt_main
 {
 	const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
 	igt_display_t display = { .drm_fd = -1 };
+	enum pipe pipe;
 	int i;
 
 	igt_skip_on_simulation();
@@ -1373,27 +1374,23 @@ igt_main
 	}
 
 	igt_subtest_group {
-		for (int n = 0; n < I915_MAX_PIPES; n++) {
+		for_each_pipe(&display, pipe) {
 			errno = 0;
 
-			igt_fixture {
-				igt_skip_on(n >= display.n_pipes);
-			}
-
-			igt_subtest_f("pipe-%s-single-bo", kmstest_pipe_name(n))
-				stress(&display, n, 1, DRM_MODE_CURSOR_BO, 20);
-			igt_subtest_f("pipe-%s-single-move", kmstest_pipe_name(n))
-				stress(&display, n, 1, DRM_MODE_CURSOR_MOVE, 20);
+			igt_subtest_f("pipe-%s-single-bo", kmstest_pipe_name(pipe))
+				stress(&display, pipe, 1, DRM_MODE_CURSOR_BO, 20);
+			igt_subtest_f("pipe-%s-single-move", kmstest_pipe_name(pipe))
+				stress(&display, pipe, 1, DRM_MODE_CURSOR_MOVE, 20);
 
-			igt_subtest_f("pipe-%s-forked-bo", kmstest_pipe_name(n))
-				stress(&display, n, ncpus, DRM_MODE_CURSOR_BO, 20);
-			igt_subtest_f("pipe-%s-forked-move", kmstest_pipe_name(n))
-				stress(&display, n, ncpus, DRM_MODE_CURSOR_MOVE, 20);
+			igt_subtest_f("pipe-%s-forked-bo", kmstest_pipe_name(pipe))
+				stress(&display, pipe, ncpus, DRM_MODE_CURSOR_BO, 20);
+			igt_subtest_f("pipe-%s-forked-move", kmstest_pipe_name(pipe))
+				stress(&display, pipe, ncpus, DRM_MODE_CURSOR_MOVE, 20);
 
-			igt_subtest_f("pipe-%s-torture-bo", kmstest_pipe_name(n))
-				stress(&display, n, -ncpus, DRM_MODE_CURSOR_BO, 20);
-			igt_subtest_f("pipe-%s-torture-move", kmstest_pipe_name(n))
-				stress(&display, n, -ncpus, DRM_MODE_CURSOR_MOVE, 20);
+			igt_subtest_f("pipe-%s-torture-bo", kmstest_pipe_name(pipe))
+				stress(&display, pipe, -ncpus, DRM_MODE_CURSOR_BO, 20);
+			igt_subtest_f("pipe-%s-torture-move", kmstest_pipe_name(pipe))
+				stress(&display, pipe, -ncpus, DRM_MODE_CURSOR_MOVE, 20);
 		}
 	}
 
-- 
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