68 Commits

Author SHA1 Message Date
Paulo Zanoni
cb3861a9e3 kms_frontbuffer_tracking: implement badstride test
Test strides that are either completely invalid or just result in
disabled FBC.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 13:04:23 -03:00
Paulo Zanoni
19e4632407 kms_frontbuffer_tracking: only force std_1024_mode on HSW
Since on BDW the big modes work fine, I want to test them without
having to recompile the test every time. Let's make std_1024_mode part
of opt.small_modes.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 11:35:05 -03:00
Paulo Zanoni
a7cfd224ba kms_frontbuffer_tracking: remove enum feature_status
After the last commit, it's not really needed anymore, so let's get
rid of it: less code lines and less non-standard enums.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 11:34:43 -03:00
Paulo Zanoni
775fd77715 kms_frontbuffer_tracking: improve checks for disabled features
Make sure the features are disabled and stay disabled. Otherwise we
could just wrongly think they are disabled while they are just in the
process of being enabled.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 11:34:23 -03:00
Paulo Zanoni
ca97e78455 kms_frontbuffer_tracking: rename enum fbs
I tried explaining these to people twice and realized how bad the
current naming was. Let's hope the new one is better.

The downside is that the tests were renamed and patches mentioning
them can't be fixed.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 11:34:02 -03:00
Paulo Zanoni
b0427442f9 kms_frontbuffer_tracking: add different ways to flip
So we can make sure all code paths are properly exercised and lead to
proper frontbuffer tracking.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 11:33:41 -03:00
Paulo Zanoni
a1d4b553a7 kms_frontbuffer_tracking: fix fullscreen subtest assertions
Only really assert FBC_DISABLED in case the primary plane is actually
disabled. If the sprite plane is covering the whole screen but the
primary plane is still enabled, FBC can remain enabled.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 11:33:14 -03:00
Paulo Zanoni
344dab22e9 kms_frontbuffer_tracking: avoid huge strides during normal operation
We want to restrict huge strides to the yet-to-be-implemented
stride-size-specific subtest.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 11:32:53 -03:00
Paulo Zanoni
c2d656c5d6 kms_frontbuffer_tracking: don't hardcode the X/Y big FB offset
While debugging the test failures I tried different values for the
offsets, so having a central place to change them is the only sane
way.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 11:32:32 -03:00
Paulo Zanoni
eeda401391 kms_frontbuffer_tracking: GTT mmap writes disable PSR
And they keep it disabled until something else enables it. So let's
consider this on the draw subtests.

With this, some PSR tests that were failing will now start passing.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-25 14:54:24 -03:00
Paulo Zanoni
053f33ad1c kms_frontbuffer_tracking: use CPU mmaps for fill_fb_region()
Because the GTT mmaps "permanently" disable PSR and this can mess
some of our assertions. So let's just use the CPU domain to keep the
implementation simple.

With this, some PSR tests that were failing will now start passing.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-25 14:53:49 -03:00
Paulo Zanoni
7a4ded7b87 kms_frontbuffer_tracking: remove offscreen-{cur,spr} subtests
It doesn't make sense to write on the sprite/cursor plane of the
"offscreen" screen. The pick_target() function was just returning the
offscreen_fb pointer for those cases, so we were not really testing
any cursor or sprite code. So the tests were just the same as
offscreen-pri.

That kills 24 subtests for each feature (72 in total).

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-25 14:53:07 -03:00
Paulo Zanoni
ce3b47bac8 tests/kms_frontbuffer_tracking: add modesetfrombusy test
This test exercies the dev_priv->fb_tracking.busy_bits bug I recently
found and Daniel fixed.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-25 14:52:26 -03:00
Paulo Zanoni
7eb5f07949 tests/kms_frontbuffer_tracking: rename set_screens_for_test
Rename it to prepare_subtest. This function used to be much smaller
when I decided its name.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-23 14:44:18 -03:00
Paulo Zanoni
7756e88445 tests/kms_frontbuffer_tracking: simplify flib_subtest fb handling
Get rid of fb2_region, use params->fb directly instead.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-23 14:43:02 -03:00
Paulo Zanoni
77e1bac6eb tests/kms_frontbuffer_tracking: simplify wait_user() calls
I often add new temoprary wait_user() calls when debugging things, and
having to add "if (opt.step)" is annoying, so let's make the step
level check inside wait_user(). As a bonus, our huge macro is 2 lines
shorter.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-23 14:41:22 -03:00
Paulo Zanoni
969cb3c575 tests/kms_frontbuffer_tracking: not all eDP panels support sink CRC
And require sink CRC support for PSR, since the pipe CRC is not
exactly useful there.

v2: Check for ENOTTY (Rodrigo).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91019
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-23 14:41:01 -03:00
Paulo Zanoni
d8acd24bdb tests: add kms_frontbuffer_tracking
This is a new test that should exercise the frontbuffer tracking
feature of the Kernel in a number of different ways. We use different
drawing methods, we use the primary, cursor and sprite planes, we can
test both on single and dual pipes, also on buffers not associated
with any CRTCs, etc.

We currently have assertions for both FBC and PSR, and we also have a
"nop" test mode that should disable both FBC and PSR, and can be
used for debugging.

This test is also capable of testing both FBC and PSR even if they are
disabled by default on the Kernel: the test knows how to change the
i915.ko parameters and then set them back after testing.

I am getting a significant number of failures when I run this test,
which means we have some work to do on the Kernel.

I also still have a small list of additional subtests that I plan to
add to this test, and those tests are documented on the main function.

v2:
 - Use igt_debugfs_open() (Thomas).
 - Use igt_test_description() (Thomas).
 - Don't check drm_open_any_master()'s result (Thomas).
 - Use igt_require_f() in some cases (Thomas).
 - Standardize some assertions.
 - Use the new module param functions.
 - Check if FBC is supported by the chipset.
 - Add new subtests (multidraw, enum fbs, fbc+psr).
 - Make tests a little shorter.
 - Reorganize which tests ara ran by default.
 - Better comments everywhere.
 - Rebase.

v3:
 - Fix a small typo.
 - Improve the log messages a little bit more.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-11 10:43:13 -03:00