summaryrefslogtreecommitdiff
path: root/lib/igt_aux.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/igt_aux.c')
-rw-r--r--lib/igt_aux.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 01654f00..0e1eeea4 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -431,6 +431,20 @@ bool igt_setup_runtime_pm(void)
if (pm_status_fd >= 0)
return true;
+ /* The Audio driver can get runtime PM references, so we need to make
+ * sure its runtime PM is enabled, so it can release the refs and
+ * actually enable us to runtime suspend. */
+ fd = open("/sys/module/snd_hda_intel/parameters/power_save", O_WRONLY);
+ if (fd >= 0) {
+ igt_assert(write(fd, "1\n", 2) == 2);
+ close(fd);
+ }
+ fd = open("/sys/bus/pci/devices/0000:00:03.0/power/control", O_WRONLY);
+ if (fd >= 0) {
+ igt_assert(write(fd, "auto\n", 5) == 5);
+ close(fd);
+ }
+
/* Our implementation uses autosuspend. Try to set it to 0ms so the test
* suite goes faster and we have a higher probability of triggering race
* conditions. */