22 Commits

Author SHA1 Message Date
Paulo Zanoni
f6d9e160c9 tests/pm_pc8: add "resuming" state
This one was missing. For some reason we never really detected it on
our test suite. I checked the Kernel source and now we should be fine.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-26 11:37:25 -02:00
Paulo Zanoni
0df88f5e64 tests/pm_pc8: try to reuse FBs when possible
Instead of creating a new FB every time we need one, create a cache of
FBs and reuse whenever possible. That means we'll create at most two
FBs, and reuse them hundreds and hundreds of times.

The kmstest_paint_test_pattern function takes about 1-2 seconds to
run, and we'll avoid it whenever we reuse the FB.

This makes the time taken to run the modeset-lpsp-stress subtest go
from 2:29 to 1:29.

A full "time ./pm_pc8 --quick" goes from 8:14 to 6:27.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-21 18:47:29 -02:00
Paulo Zanoni
78227101e2 tests/pm_pc8: try harder to reach PC8+ residencies
If we want to actually reach PC8+ states, we need to properly
configure all the devices on the system to allow this. This function
will try to setup the things we know we need, but won't scream in case
anything fails: we don't know which devices are present on your
machine, so we can't really expect anything, just try to help with the
more common problems.

Another reason for this commit is that I got tired of having to
readjust the runtime PM policies every time I reboot my machine.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-21 17:36:57 -02:00
Paulo Zanoni
e9363973b1 tests/pm_pc8: rename some subtests
Due to copy/paste error, we had 3 subtests called gem-execbuf-stress.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-21 15:11:21 -02:00
Paulo Zanoni
f7abef6618 tests/pm_pc8: add --quick option
Not meant to be used on the QA cycles, but by developers who just want
to quickly check things while doing development. Reduces the total
time from 27 minutes to 6 minutes on my machine.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-14 19:59:50 -02:00
Paulo Zanoni
4826546746 tests/pm_pc8: add some more stress tests
I was suspecting some problems just happen if we have a bigger wait
than the current ones we have, so add a new WAIT_EXTRA flag just to
see if the problems really happen. Also, add support for the wait
flags on the gem stress tests, and use them.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-14 19:59:44 -02:00
Paulo Zanoni
4fa9dde799 tests/pm_pc8: remove compare_registers subtest
It's not executed by default, and it's completely relying on Haswell
registers and on internal knowledge of how the Kernel is supposed to
work. Since we plan to test generic runtime PM on all supported
platforms, maintaining this test so it works on all those platforms
will be a pain. We already have some ideas on how to verify registers
that must stay at specific values from inside the Kernel, so let's
kill this test and wait until the proper Kernel code gets merged.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-14 19:59:37 -02:00
Paulo Zanoni
a8610a4776 tests/pm_pc8: rename some variables
Since we're not only testing PC8 anymore, we're resting "PM", rename
some variables from something_pc8 to something_suspend, just to make
it not-so-confusing.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-14 19:59:30 -02:00
Paulo Zanoni
19c8d5f4ff tests/pm_pc8: fix debugfs-forcewake-user for PC8-only cases
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>
2013-11-14 19:59:23 -02:00
Paulo Zanoni
63e4dafb32 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>
2013-11-14 19:59:16 -02:00
Paulo Zanoni
a4e96a95ca tests/pm_pc8: add support for runtime PM
We try to detect if we have runtime PM or if we just have PC8. In case
there's runtime PM, the functions that wait will wait for the runtime
PM status reported by the sysfs file instead of waiting for PC8
residencies to move.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-14 19:59:09 -02:00
Chris Wilson
217bd8d55e tests/pm_pc8: Fix invalid pointer-to-integer casting
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71592
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-14 09:48:24 +00:00
Oscar Mateo
37f26d17b1 lib: Move kms stuff from drmtest.c over to igt_kms.c
This makes cairo dependencies easier to handle. Otherwise, we
would have to litter drmtest all over with "#ifndef ANDROID"

Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
[danvet: Add missing _GNU_SOURCE to igt_kms.c and missing include to
intel_sprite_on.c]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-12 12:04:12 +01:00
Paulo Zanoni
0d902cad5f tests/pm_pc8: reorganize main function
Split the tests into categories. There are too many tests, it's
getting harder to locate the ones we need.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-08 19:38:03 -02:00
Paulo Zanoni
c527a29325 tests/pm_pc8: add some GEM tests
These are more complete tests than the previous test_batch() one. We
test CPU/GTT mmaps, pread/pwrite and batch buffers.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-08 19:38:03 -02:00
Paulo Zanoni
79670c54eb tests/pm_pc8: remove "batch" and "stress-test" subtests
They use a bad BLT command and don't check its result. The next patch
will add proper GEM tests that contain commands that work and code
that checks if the command is really working.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-08 19:38:03 -02:00
Paulo Zanoni
3775eae051 tests/pm_pc8: add debugfs/sysfs tests
They don't really exercise any particular special code path for PC8,
but the runtime D3 code will touch these code paths, so we'll need the
tests.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-08 18:40:22 -02:00
Paulo Zanoni
0fbb834646 tests/pm_pc8: add modeset-lpsp-stress
It's the only one we were missing form the possible combinations.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-08 18:40:22 -02:00
Paulo Zanoni
1bcae02e5c tests/pm_pc8: extract i2c_subtest_check_environment
Just to make it more organized and consistent with the other tests.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-08 18:40:22 -02:00
Paulo Zanoni
2fd0eb53aa tests/pm_pc8: return void on test_i2c
And do the assertion in the code line that actually verifies the
condition we need. Makes it easier to debug failed tests.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-08 18:40:22 -02:00
Paulo Zanoni
514efb507d tests/pm_pc8: move teardown_environment next to setup_environment
So I can add/remove/verify code more easily.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-11-08 18:40:22 -02:00
Daniel Vetter
5738f1952d tests: establish pm_ prefix
Imo power management, power consumption and performance are tightly
enough coupled that we can throw them all into one bin.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-04 19:49:10 +01:00