summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBhanuprakash Modem <bhanuprakash.modem@intel.com>2022-06-10 14:15:39 +0530
committerBhanuprakash Modem <bhanuprakash.modem@intel.com>2022-06-15 09:26:53 +0530
commit54ff3199bc2c1ba586f5d608bd91d2b3eea66202 (patch)
tree9b8919753e3b376d715ba230b90ad4088e3c5acd
parent0e1339e03075380b45ec1b3ce3598bd5406f3a46 (diff)
tests/kms_cursor_edge_walk: Convert tests to dynamic
Convert the existing subtests to dynamic subtests at pipe level. V2: * Fix nested igt_fixture in igt_subtest V3: * Add output name to subtest Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Reviewed-by: Swati Sharma <swati2.sharma@intel.com>
-rw-r--r--tests/kms_cursor_edge_walk.c63
1 files changed, 28 insertions, 35 deletions
diff --git a/tests/kms_cursor_edge_walk.c b/tests/kms_cursor_edge_walk.c
index b775714f..526bc6b3 100644
--- a/tests/kms_cursor_edge_walk.c
+++ b/tests/kms_cursor_edge_walk.c
@@ -309,6 +309,17 @@ static const char *help_str =
igt_main_args("", long_opts, help_str, opt_handler, &data)
{
+ struct {
+ const char *name;
+ unsigned flags;
+ } tests[] = {
+ { "left-edge", EDGE_LEFT },
+ { "right-edge", EDGE_RIGHT },
+ { "top-edge", EDGE_TOP },
+ { "top-bottom", EDGE_BOTTOM },
+ };
+ int i;
+
igt_fixture {
int ret;
@@ -328,44 +339,26 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
igt_require_pipe_crc(data.drm_fd);
igt_display_require(&data.display, data.drm_fd);
+ igt_display_require_output(&data.display);
}
- for_each_pipe_static(data.pipe) {
- igt_subtest_group {
- igt_fixture {
- igt_display_require_output_on_pipe(&data.display, data.pipe);
- data.output = igt_get_single_output_for_pipe(&data.display, data.pipe);
- }
-
- for (data.curw = 64; data.curw <= 256; data.curw *= 2) {
- data.curh = data.curw;
-
- igt_fixture
+ igt_describe("Checking cursor by walking left/right/top/bottom edge of screen");
+ igt_subtest_group {
+ for (i = 0; i < ARRAY_SIZE(tests); i++) {
+ igt_subtest_with_dynamic(tests[i].name) {
+ for_each_pipe(&data.display, data.pipe) {
igt_require(data.curw <= max_curw && data.curh <= max_curh);
-
- igt_describe("Checking cursor by walking left edge of screen");
- igt_subtest_f("pipe-%s-%dx%d-left-edge",
- kmstest_pipe_name(data.pipe),
- data.curw, data.curh)
- test_crtc(&data, EDGE_LEFT);
-
- igt_describe("Checking cursor by walking right edge of screen");
- igt_subtest_f("pipe-%s-%dx%d-right-edge",
- kmstest_pipe_name(data.pipe),
- data.curw, data.curh)
- test_crtc(&data, EDGE_RIGHT);
-
- igt_describe("Checking cursor by walking top edge of screen");
- igt_subtest_f("pipe-%s-%dx%d-top-edge",
- kmstest_pipe_name(data.pipe),
- data.curw, data.curh)
- test_crtc(&data, EDGE_TOP);
-
- igt_describe("Checking cursor by walking bottom edge of screen");
- igt_subtest_f("pipe-%s-%dx%d-bottom-edge",
- kmstest_pipe_name(data.pipe),
- data.curw, data.curh)
- test_crtc(&data, EDGE_BOTTOM);
+ data.output = igt_get_single_output_for_pipe(&data.display, data.pipe);
+
+ for (data.curw = 64; data.curw <= 256; data.curw *= 2) {
+ data.curh = data.curw;
+ igt_dynamic_f("pipe-%s-%s-%dx%d",
+ kmstest_pipe_name(data.pipe),
+ data.output->name,
+ data.curw, data.curh)
+ test_crtc(&data, tests[i].flags);
+ }
+ }
}
}
}