From 229d7d27e5a24fa8e4155ada48467b16db9486e0 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Mon, 14 Aug 2017 11:32:05 +0200 Subject: lib/kms: Add for_each_pipe_static for_each_pipe cannot be used for enumerating testcases, so provide something that can. Signed-off-by: Daniel Vetter Reviewed-by: Petri Latvala --- tests/kms_busy.c | 3 ++- tests/kms_concurrent.c | 3 ++- tests/kms_cursor_legacy.c | 3 ++- tests/kms_pipe_color.c | 3 ++- tests/kms_plane.c | 3 ++- tests/kms_plane_lowres.c | 4 +++- tests/kms_plane_multiple.c | 3 ++- tests/kms_universal_plane.c | 4 +++- 8 files changed, 18 insertions(+), 8 deletions(-) (limited to 'tests') 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); } -- cgit v1.2.3