tests/pm_pc8: check for PC8 status, not residency in most cases
authorPaulo Zanoni <paulo.r.zanoni@intel.com>
Tue, 12 Nov 2013 19:04:50 +0000 (17:04 -0200)
committerPaulo Zanoni <paulo.r.zanoni@intel.com>
Thu, 14 Nov 2013 21:59:16 +0000 (19:59 -0200)
commit63e4dafb3252c5ee658572181b2d7a06a3a66969
treec7de68bf7afa46dcfb688bdfd34c551e56cfc970
parenta4e96a95ca6468a7ece9fff1c8e1949691439ed4
tests/pm_pc8: check for PC8 status, not residency in most cases

If you really want to reach the PC8+ states and consequently get PC8+
residency, you need to properly configure all the devices on your
machine to allow PC8+, not just graphics. The current code for PC8
checks for PC8+ residency everywhere, so if you have a machine that's
not properly configured you'll fail every test. OTOH, even if your
machine can't reach the PC8+ states, it will still try to enable and
disable PC8, so we can try to test the feature even if we're never
really reaching the PC8+ states. Also, if your machine does allow PC8+
residencies, but some other driver/program decides to keep the machine
busy while you're running the test suite, you'll also get failures
which you shouldn't be getting.

Based on the arguments above, I'm changing most of the subtests to
only check for the PC8 status reported by sysfs (enabled/disabled),
not check real PC8+ residency. I also added two tests that should
check for PC8+ residency, so we will stil be able to diagnose badly
configured machines.

As a bonus, we won't sleep for full 5 seconds every time we expect PC8
to be disabled: we'll just read i915_pc8_status, which quickly gives
the result we're expecting. Considering how many modeset stress
subtests we have in the program, we'll save a *lot* of time with this
change.

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