[PATCH i-g-t v8 6/6] tests/kms_flip: test suspend at most twice on SNB && BMG

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

gettime_us() on SNB and BMG does not return proper time after starting
suspend tests. This results in too many suspends issued before we hit
the duration_ms. Break the loop on second execution.

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

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index f17d027cc..3c5428ff0 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1322,6 +1322,12 @@ static bool event_loop(struct test_output *o, unsigned duration_ms,
{
unsigned long start, end;
int count = 0;
+ int devid;
+ bool wa;
+
+ devid = intel_get_drm_devid(drm_fd);
+
+ wa = IS_SANDYBRIDGE(devid) || IS_BATTLEMAGE(devid);

start = gettime_us();

@@ -1342,6 +1348,9 @@ static bool event_loop(struct test_output *o, unsigned duration_ms,
if (count && (gettime_us() - start) / 1000 >= duration_ms)
break;

+ if (count && wa && o->flags & TEST_SUSPEND)
+ break;
+
count++;
}

--
2.45.2