Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/kms_async_flips: Re-calculate min flips per frame
@ 2024-03-14  5:54 Bhanuprakash Modem
  2024-03-14  6:34 ` [i-g-t V2] " Bhanuprakash Modem
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Bhanuprakash Modem @ 2024-03-14  5:54 UTC (permalink / raw)
  To: igt-dev; +Cc: Bhanuprakash Modem, Vandita Kulkarni

As XE driver taking longer time for pinning, re-calculate to
reduce the expected min flips per frame (by assuming the min
pinning time as 1.2 ms). Otherwise test will fail, since we
can't achieve those many flips per frame.

Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/kms_async_flips.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
index 2895168f7..ec2d86f4e 100644
--- a/tests/kms_async_flips.c
+++ b/tests/kms_async_flips.c
@@ -238,6 +238,19 @@ static void test_async_flip(data_t *data)
 	int ret, frame;
 	long long int fps;
 	struct timeval start, end, diff;
+	int min_flips_per_frame;
+
+	/*
+	 * FIXME: As pinning is taking moretime in XE, recalculate min frames
+	 * per frame (by considering the pinning time as 1.2 ms)
+	 */
+	min_flips_per_frame = 1000 / (data->refresh_rate * 1.2);
+	igt_require(min_flips_per_frame);
+
+	if (min_flips_per_frame > MIN_FLIPS_PER_FRAME)
+		min_flips_per_frame = MIN_FLIPS_PER_FRAME;
+
+	igt_info("Expected min flips per frame: %d\n", min_flips_per_frame);
 
 	igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
 
@@ -296,10 +309,10 @@ static void test_async_flip(data_t *data)
 		timersub(&end, &start, &diff);
 
 		if (data->alternate_sync_async) {
-			igt_assert_f(data->flip_interval < 1000.0 / (data->refresh_rate * MIN_FLIPS_PER_FRAME),
+			igt_assert_f(data->flip_interval < 1000.0 / (data->refresh_rate * min_flips_per_frame),
 				     "Flip interval not significantly smaller than vblank interval\n"
 				     "Flip interval: %lfms, Refresh Rate = %dHz, Threshold = %d\n",
-				     data->flip_interval, data->refresh_rate, MIN_FLIPS_PER_FRAME);
+				     data->flip_interval, data->refresh_rate, min_flips_per_frame);
 		}
 
 		frame++;
@@ -307,7 +320,7 @@ static void test_async_flip(data_t *data)
 
 	if (!data->alternate_sync_async) {
 		fps = frame * 1000 / RUN_TIME;
-		igt_assert_f((fps / 1000) > (data->refresh_rate * MIN_FLIPS_PER_FRAME),
+		igt_assert_f((fps / 1000) > (data->refresh_rate * min_flips_per_frame),
 			     "FPS should be significantly higher than the refresh rate\n");
 	}
 }
-- 
2.43.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-03-15  8:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-14  5:54 [PATCH i-g-t] tests/kms_async_flips: Re-calculate min flips per frame Bhanuprakash Modem
2024-03-14  6:34 ` [i-g-t V2] " Bhanuprakash Modem
2024-03-14  7:05 ` ✓ Fi.CI.BAT: success for " Patchwork
2024-03-14  7:08 ` ✓ CI.xeBAT: " Patchwork
2024-03-14  7:26 ` ✓ CI.xeBAT: success for tests/kms_async_flips: Re-calculate min flips per frame (rev2) Patchwork
2024-03-14  7:44 ` ✓ Fi.CI.BAT: " Patchwork
2024-03-14 20:50 ` ✗ Fi.CI.IGT: failure for tests/kms_async_flips: Re-calculate min flips per frame Patchwork
2024-03-14 22:00 ` ✗ Fi.CI.IGT: failure for tests/kms_async_flips: Re-calculate min flips per frame (rev2) Patchwork
2024-03-15  8:42 ` [PATCH i-g-t] tests/kms_async_flips: Re-calculate min flips per frame Ville Syrjälä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox