[PATCH i-g-t 1/3] tests/kms_async_flips: Fix suspend-resume subtest

Karthik B S karthik.b.s at intel.com
Thu Jun 19 11:23:32 UTC 2025


Currently suspend-resume subtest is only running on the first pipe as
the variable is set to false in the first iteration.

Add a temp variable to avoid this and actually run the test on all the
pipes as intended.

Signed-off-by: Karthik B S <karthik.b.s at intel.com>
---
 tests/kms_async_flips.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
index 065ac9c49..0f2d932e4 100644
--- a/tests/kms_async_flips.c
+++ b/tests/kms_async_flips.c
@@ -377,6 +377,7 @@ static void test_async_flip(data_t *data)
 	long long int fps;
 	struct timeval start, end, diff;
 	int suspend_time = RUN_TIME / 2;
+	bool temp = data->suspend_resume;
 
 	igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
 
@@ -432,8 +433,8 @@ static void test_async_flip(data_t *data)
 				     data->flip_interval, data->refresh_rate, MIN_FLIPS_PER_FRAME);
 		}
 
-		if (data->suspend_resume && diff.tv_sec == suspend_time) {
-			data->suspend_resume = false;
+		if (data->suspend_resume && diff.tv_sec == suspend_time && temp) {
+			temp = false;
 			igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
 		}
 		frame++;
@@ -1028,6 +1029,7 @@ igt_main
 		test_init_ops(&data);
 		data.suspend_resume = true;
 		run_test(&data, test_async_flip);
+		data.suspend_resume = false;
 	}
 
 	igt_fixture {
-- 
2.43.0



More information about the igt-dev mailing list