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

Karthik B S karthik.b.s at intel.com
Wed Jul 23 05:53:50 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>
Reviewed-by: Santhosh Reddy Guddati <santhosh.reddy.guddati 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 4088d8211..2fa4f2e6f 100644
--- a/tests/kms_async_flips.c
+++ b/tests/kms_async_flips.c
@@ -388,6 +388,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);
@@ -474,8 +475,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 && !data->async_mod_formats) {
-		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