summaryrefslogtreecommitdiff
path: root/lib/igt_aux.c
diff options
context:
space:
mode:
authorDavid Weinehall <david.weinehall@linux.intel.com>2016-02-18 13:08:46 +0200
committerMarius Vlad <marius.c.vlad@intel.com>2016-02-19 12:10:21 +0200
commit15deba45756eeeacca2ad83ac931606986f8d669 (patch)
treef8f096c774c61e7a662401b6cfac10809039a910 /lib/igt_aux.c
parent16038908de5ef491c8c795ae48ed880de235c532 (diff)
lib/igt_pm: Lib for power management
Move power management related code to a separate library. Initially this is done only for workarounds that apply to external components. Modify the users of such workarounds accordingly. This currently involves HD audio and SATA link power management. For SATA link PM there's also code to save the previous settings, to allow for resetting the values after we've finished testing. Signed-off-by: David Weinehall <david.weinehall@intel.com> Reviewed-by: Marius Vlad <marius.c.vlad@intel.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
Diffstat (limited to 'lib/igt_aux.c')
-rw-r--r--lib/igt_aux.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index ebee119c..7d35666e 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -59,6 +59,7 @@
#include "intel_reg.h"
#include "ioctl_wrappers.h"
#include "igt_kms.h"
+#include "igt_pm.h"
/**
* SECTION:igt_aux
@@ -544,19 +545,7 @@ 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);
- }
+ igt_pm_enable_audio_runtime_pm();
/* 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