[PATCH i-g-t v2 2/4] tests/kms_async_flips: Modify subtest runtime for suspend resume subtest

Karthik B S karthik.b.s at intel.com
Tue Jun 24 09:24:18 UTC 2025


After a suspend cycle, the next flip will be treated as a sync flip and
will consume the full vblank time. To account for this remove this from
the runtime in FPS calculations.

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

diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
index 0f2d932e4..677da5aba 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;
+	float run_time;
 	bool temp = data->suspend_resume;
 
 	igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
@@ -440,8 +441,13 @@ static void test_async_flip(data_t *data)
 		frame++;
 	} while (diff.tv_sec < RUN_TIME);
 
+	if (data->suspend_resume)
+		run_time = RUN_TIME - (1.0 / data->refresh_rate);
+	else
+		run_time = RUN_TIME;
+
 	if (!data->alternate_sync_async) {
-		fps = frame * 1000 / RUN_TIME;
+		fps = frame * 1000 / run_time;
 		igt_assert_f((fps / 1000) > (data->refresh_rate * MIN_FLIPS_PER_FRAME),
 			     "FPS should be significantly higher than the refresh rate\n");
 	}
-- 
2.43.0



More information about the igt-dev mailing list