All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/perf_pmu: Restore runtime PM at subtest exit
@ 2018-07-19 16:37 ` Tvrtko Ursulin
  0 siblings, 0 replies; 17+ messages in thread
From: Tvrtko Ursulin @ 2018-07-19 16:37 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Tvrtko Ursulin

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Restore runtime PM state (via a newly added library function) when the
test which sets it up exit. This was we avoid running all subsequent sub-
tests in the aggressive runtime PM mode.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 lib/igt_pm.c     | 13 ++++++++++++-
 lib/igt_pm.h     |  1 +
 tests/perf_pmu.c |  3 +++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/lib/igt_pm.c b/lib/igt_pm.c
index 8ac132269d79..2e2eea5d3b2d 100644
--- a/lib/igt_pm.c
+++ b/lib/igt_pm.c
@@ -297,7 +297,13 @@ int pm_status_fd = -1;
 static char __igt_pm_runtime_autosuspend[64];
 static char __igt_pm_runtime_control[64];
 
-static void __igt_pm_runtime_exit_handler(int sig)
+/**
+ * igt_restore_runtime_pm:
+ *
+ * Restores the runtime PM configuration as it was before the call to
+ * igt_setup_runtime_pm.
+ */
+void igt_restore_runtime_pm(void)
 {
 	int fd;
 
@@ -326,6 +332,11 @@ static void __igt_pm_runtime_exit_handler(int sig)
 	close(fd);
 }
 
+static void __igt_pm_runtime_exit_handler(int sig)
+{
+	igt_restore_runtime_pm();
+}
+
 /**
  * igt_setup_runtime_pm:
  *
diff --git a/lib/igt_pm.h b/lib/igt_pm.h
index eced39f8801a..10cc6794e4e7 100644
--- a/lib/igt_pm.h
+++ b/lib/igt_pm.h
@@ -47,6 +47,7 @@ enum igt_runtime_pm_status {
 };
 
 bool igt_setup_runtime_pm(void);
+void igt_restore_runtime_pm(void);
 enum igt_runtime_pm_status igt_get_runtime_pm_status(void);
 bool igt_wait_for_pm_status(enum igt_runtime_pm_status status);
 
diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index a1d36ac4fa9d..9a20abb6b95c 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -1441,6 +1441,9 @@ test_rc6(int gem_fd, unsigned int flags)
 	close(fw);
 	close(fd);
 
+	if (flags & TEST_RUNTIME_PM)
+		igt_restore_runtime_pm();
+
 	assert_within_epsilon(busy - prev, 0.0, tolerance);
 }
 
-- 
2.17.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2018-07-20 13:39 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-19 16:37 [igt-dev] [PATCH i-g-t] tests/perf_pmu: Restore runtime PM at subtest exit Tvrtko Ursulin
2018-07-19 16:37 ` Tvrtko Ursulin
2018-07-19 16:48 ` [igt-dev] " Chris Wilson
2018-07-19 16:48   ` Chris Wilson
2018-07-20  9:42   ` [Intel-gfx] [PATCH i-g-t v2] " Tvrtko Ursulin
2018-07-20  9:42     ` Tvrtko Ursulin
2018-07-20  9:50     ` [igt-dev] " Chris Wilson
2018-07-20  9:50       ` Chris Wilson
2018-07-20 12:12       ` [igt-dev] [PATCH i-g-t v3] " Tvrtko Ursulin
2018-07-20 12:12         ` Tvrtko Ursulin
2018-07-20 12:21         ` [Intel-gfx] [igt-dev] " Chris Wilson
2018-07-20 12:21           ` Chris Wilson
2018-07-19 17:02 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-07-19 20:36 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-07-20 10:02 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/perf_pmu: Restore runtime PM at subtest exit (rev2) Patchwork
2018-07-20 13:33 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-07-20 13:39 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/perf_pmu: Restore runtime PM at subtest exit (rev3) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.