[PATCH i-g-t v8 1/6] tests/kms_flip: test suspend on one pair of pipes

Michał Grzelak
2026-03-09T09:25:43Z

Currently, every pair of ({pipe1, pipe2}, {output1, output2}) is being
tested in 2x-* subtests. Since suspend shouldn't be tested per pipe, it
causes unnecessary overhead: with 4 pipes & 4 displays it runs up to 36
tests. Given that each suspend's dynamic subtest can take up to tens of
seconds, total duration of the test easily exceeds timeout.

When testing suspend, for each pair of outputs test only first and last
pipe unless it is said to run on all pipes.

Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
---
tests/kms_flip.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 49a5f4ed1..8bda82627 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1918,6 +1918,12 @@ static void run_pair(int duration, int flags)
for (n = 0; n < resources->count_crtcs; n++) {
for (j = i + 1; j < resources->count_connectors; j++) {
for (m = n + 1; m < resources->count_crtcs; m++) {
+ /* Limit the execution to 2 CRTCs (first & last) for hang and suspend tests */
+ if (((flags & TEST_HANG) || (flags & TEST_SUSPEND)) && !all_crtcs &&
+ ((n != 0 && n != resources->count_crtcs) ||
+ m != resources->count_crtcs - 1))
+ continue;
+
memset(&o, 0, sizeof(o));
o.count = 2;
o._connector[0] = resources->connectors[i];
@@ -1963,8 +1969,8 @@ static void run_pair(int duration, int flags)
crtc_idxs[0] = n;
crtc_idxs[1] = m;

- /* Limit the execution to 2 CRTCs (first & last) for hang tests */
- if ((flags & TEST_HANG) && !all_crtcs &&
+ /* Limit the execution to 2 CRTCs (first & last) for hang and suspend tests */
+ if (((flags & TEST_HANG) || (flags & TEST_SUSPEND)) && !all_crtcs &&
((n != 0 && n != resources->count_crtcs) ||
m != resources->count_crtcs - 1))
continue;
--
2.45.2