tests/pm_pc8: fix debugfs-forcewake-user for PC8-only cases
authorPaulo Zanoni <paulo.r.zanoni@intel.com>
Thu, 14 Nov 2013 15:35:43 +0000 (13:35 -0200)
committerPaulo Zanoni <paulo.r.zanoni@intel.com>
Thu, 14 Nov 2013 21:59:23 +0000 (19:59 -0200)
We don't wake up from forcewake when we only have PC8, but not runtime
PM, so make the test pass.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
tests/pm_pc8.c

index 753c12d..391f1db 100644 (file)
@@ -985,9 +985,13 @@ static void debugfs_forcewake_user_subtest(void)
        fd = open("/sys/kernel/debug/dri/0/i915_forcewake_user", O_RDONLY);
        igt_require(fd);
 
-       igt_assert(wait_for_active());
-       sleep(10);
-       igt_assert(wait_for_active());
+       if (has_runtime_pm) {
+               igt_assert(wait_for_active());
+               sleep(10);
+               igt_assert(wait_for_active());
+       } else {
+               igt_assert(wait_for_suspended());
+       }
 
        rc = close(fd);
        igt_assert(rc == 0);