summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/igt_kms.h16
-rw-r--r--tests/kms_busy.c3
-rw-r--r--tests/kms_concurrent.c3
-rw-r--r--tests/kms_cursor_legacy.c3
-rw-r--r--tests/kms_pipe_color.c3
-rw-r--r--tests/kms_plane.c3
-rw-r--r--tests/kms_plane_lowres.c4
-rw-r--r--tests/kms_plane_multiple.c3
-rw-r--r--tests/kms_universal_plane.c4
9 files changed, 34 insertions, 8 deletions
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 35428f3e..b28fe8c5 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -463,10 +463,26 @@ static inline bool igt_output_is_connected(igt_output_t *output)
/**
* for_each_pipe:
+ * @pipe: The pipe to iterate.
+ *
+ * This for loop iterates over all pipes supported by IGT libraries.
+ *
+ * This should be used to enumerate per-pipe subtests since it has no runtime
+ * depencies.
+ */
+#define for_each_pipe_static(pipe) \
+ for (pipe = 0; pipe < IGT_MAX_PIPES; pipe++)
+
+/**
+ * for_each_pipe:
* @display: a pointer to an #igt_display_t structure
* @pipe: The pipe to iterate.
*
* This for loop iterates over all pipes.
+ *
+ * Note that this cannot be used to enumerate per-pipe subtest names since it
+ * depends upon runtime probing of the actual kms driver that is being tested.
+ * Used #for_each_pipe_static instead.
*/
#define for_each_pipe(display, pipe) \
for (pipe = 0; pipe < igt_display_get_n_pipes(display); pipe++)
diff --git a/tests/kms_busy.c b/tests/kms_busy.c
index dc002140..ecf0b2eb 100644
--- a/tests/kms_busy.c
+++ b/tests/kms_busy.c
@@ -311,6 +311,7 @@ igt_main
igt_display_t display = { .drm_fd = -1, .n_pipes = IGT_MAX_PIPES };
/* we only test on render */
const struct intel_execution_engine *e = &intel_execution_engines[1];
+ enum pipe n;
igt_skip_on_simulation();
@@ -327,7 +328,7 @@ igt_main
/* XXX Extend to cover atomic rendering tests to all planes + legacy */
- for (int n = 0; n < IGT_MAX_PIPES; n++) {
+ for_each_pipe_static(n) {
errno = 0;
igt_fixture {
diff --git a/tests/kms_concurrent.c b/tests/kms_concurrent.c
index e2cde4ee..5d1e0bc5 100644
--- a/tests/kms_concurrent.c
+++ b/tests/kms_concurrent.c
@@ -401,6 +401,7 @@ int main(int argc, char *argv[])
{ "seed", required_argument, NULL, 's'},
{ 0, 0, 0, 0 }
};
+ enum pipe pipe;
igt_subtest_init_parse_opts(&argc, argv, "", long_options, help_str,
opt_handler, NULL);
@@ -415,7 +416,7 @@ int main(int argc, char *argv[])
igt_require(data.display.is_atomic);
}
- for (int pipe = 0; pipe < IGT_MAX_PIPES; pipe++) {
+ for_each_pipe_static(pipe) {
igt_subtest_group
run_tests_for_pipe(&data, pipe);
}
diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
index 15208f8b..bdb66f3b 100644
--- a/tests/kms_cursor_legacy.c
+++ b/tests/kms_cursor_legacy.c
@@ -1425,7 +1425,8 @@ igt_main
}
igt_subtest_group {
- for (int n = 0; n < IGT_MAX_PIPES; n++) {
+ enum pipe n;
+ for_each_pipe_static(n) {
errno = 0;
igt_fixture {
diff --git a/tests/kms_pipe_color.c b/tests/kms_pipe_color.c
index 12400686..ccfc08e6 100644
--- a/tests/kms_pipe_color.c
+++ b/tests/kms_pipe_color.c
@@ -1189,6 +1189,7 @@ invalid_ctm_matrix_sizes(data_t *data)
igt_main
{
data_t data = {};
+ enum pipe pipe;
igt_skip_on_simulation();
@@ -1200,7 +1201,7 @@ igt_main
igt_display_init(&data.display, data.drm_fd);
}
- for (int pipe = 0; pipe < IGT_MAX_PIPES; pipe++)
+ for_each_pipe_static(pipe)
igt_subtest_group
run_tests_for_pipe(&data, pipe);
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 1d92a62b..927d5d37 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -424,6 +424,7 @@ static data_t data;
igt_main
{
+ enum pipe pipe;
igt_skip_on_simulation();
@@ -436,7 +437,7 @@ igt_main
igt_display_init(&data.display, data.drm_fd);
}
- for (int pipe = 0; pipe < IGT_MAX_PIPES; pipe++)
+ for_each_pipe_static(pipe)
run_tests_for_pipe_plane(&data, pipe);
igt_fixture {
diff --git a/tests/kms_plane_lowres.c b/tests/kms_plane_lowres.c
index ee39759c..b16c8cd4 100644
--- a/tests/kms_plane_lowres.c
+++ b/tests/kms_plane_lowres.c
@@ -339,6 +339,8 @@ static data_t data;
igt_main
{
+ enum pipe pipe;
+
igt_skip_on_simulation();
igt_fixture {
@@ -350,7 +352,7 @@ igt_main
igt_display_init(&data.display, data.drm_fd);
}
- for (int pipe = 0; pipe < IGT_MAX_PIPES; pipe++)
+ for_each_pipe_static(pipe)
run_tests_for_pipe(&data, pipe);
igt_fixture {
diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
index 4bc26b73..aea59df8 100644
--- a/tests/kms_plane_multiple.c
+++ b/tests/kms_plane_multiple.c
@@ -492,6 +492,7 @@ int main(int argc, char *argv[])
{ "seed", required_argument, NULL, 's'},
{ 0, 0, 0, 0 }
};
+ enum pipe pipe;
igt_subtest_init_parse_opts(&argc, argv, "", long_options, help_str,
opt_handler, NULL);
@@ -506,7 +507,7 @@ int main(int argc, char *argv[])
igt_require(data.display.n_pipes > 0);
}
- for (int pipe = 0; pipe < IGT_MAX_PIPES; pipe++) {
+ for_each_pipe_static(pipe) {
igt_subtest_group
run_tests_for_pipe(&data, pipe);
}
diff --git a/tests/kms_universal_plane.c b/tests/kms_universal_plane.c
index 31f07804..58f329e6 100644
--- a/tests/kms_universal_plane.c
+++ b/tests/kms_universal_plane.c
@@ -787,6 +787,8 @@ static data_t data;
igt_main
{
+ enum pipe pipe;
+
igt_skip_on_simulation();
igt_fixture {
@@ -799,7 +801,7 @@ igt_main
igt_display_init(&data.display, data.drm_fd);
}
- for (int pipe = 0; pipe < IGT_MAX_PIPES; pipe++) {
+ for_each_pipe_static(pipe) {
igt_subtest_group
run_tests_for_pipe(&data, pipe);
}