public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t] perf: Verify rc6 works first
@ 2020-04-24 10:19 Chris Wilson
  2020-04-24 10:58 ` [igt-dev] " Lionel Landwerlin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chris Wilson @ 2020-04-24 10:19 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Chris Wilson

We want to verify that OA disables rc6 (so that its metrics are not
interrupted by the device sleeping), and once OA is finished, the device
is allowed to sleep again. If rc6 is broken, the test fails since rc6
never recovers -- but that is expected as rc6 is broken.

Skip the test rather than fail for an external issue; we know rc6 is
broken on ehl!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/perf.c | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/tests/perf.c b/tests/perf.c
index b7d5e50e3..24d245496 100644
--- a/tests/perf.c
+++ b/tests/perf.c
@@ -4147,27 +4147,35 @@ test_rc6_disable(void)
 		.num_properties = sizeof(properties) / 16,
 		.properties_ptr = to_user_pointer(properties),
 	};
-	unsigned long n_events_start, n_events_end;
-	unsigned long rc6_enabled;
+	unsigned long rc6_start, rc6_end, rc6_enabled;
 
 	rc6_enabled = 0;
 	igt_sysfs_scanf(sysfs, "power/rc6_enable", "%lu", &rc6_enabled);
 	igt_require(rc6_enabled);
 
+	/* Verify rc6 is functional by measuring residency while idle */
+	gem_quiescent_gpu(drm_fd);
+	rc6_start = rc6_residency_ms();
+	usleep(50000);
+	rc6_end = rc6_residency_ms();
+	igt_require(rc6_end != rc6_start);
+
+	/* While OA is active, we keep rc6 disabled so we don't lose metrics */
 	stream_fd = __perf_open(drm_fd, &param, false);
 
-	n_events_start = rc6_residency_ms();
-	nanosleep(&(struct timespec){ .tv_sec = 0, .tv_nsec = 500000000 }, NULL);
-	n_events_end = rc6_residency_ms();
-	igt_assert_eq(n_events_end - n_events_start, 0);
+	rc6_start = rc6_residency_ms();
+	usleep(50000);
+	rc6_end = rc6_residency_ms();
+	igt_assert_eq(rc6_end - rc6_start, 0);
 
 	__perf_close(stream_fd);
 	gem_quiescent_gpu(drm_fd);
 
-	n_events_start = rc6_residency_ms();
-	nanosleep(&(struct timespec){ .tv_sec = 1, .tv_nsec = 0 }, NULL);
-	n_events_end = rc6_residency_ms();
-	igt_assert_neq(n_events_end - n_events_start, 0);
+	/* But once OA is closed, we expect the device to sleep again */
+	rc6_start = rc6_residency_ms();
+	usleep(50000);
+	rc6_end = rc6_residency_ms();
+	igt_assert_neq(rc6_end - rc6_start, 0);
 }
 
 static void
-- 
2.26.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2020-04-24 13:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-24 10:19 [Intel-gfx] [PATCH i-g-t] perf: Verify rc6 works first Chris Wilson
2020-04-24 10:58 ` [igt-dev] " Lionel Landwerlin
2020-04-24 11:24 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-04-24 13:00 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

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