Use the igt_set_module_param_int() call to enable it, then restore the
previous value after we are done testing.
With this, we can change the psr_enabled() function to psr_possible():
the only requirement should be that we have a PSR capable sink. The
test should now be able to make "Source_OK" and "Enabled" become true
whenever it wants.
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
We may not be perfect, but if we don't even test, we will probably
only get worse over time.
The function called makes sure we restore whatever was the original
FBC parameter when we exit the test, so this should not affect the
other tests.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Some i915.ko features have very nice IGT tests, which are never
executed because the features are disabled by default. This leads to
unnoticed regressions both in the Kernel and in the IGT tests. We
have seen this multiple times, for example, on FBC and PSR.
We want to be able to run IGT and actually test these
disabled-by-default features in order to make sure we at least don't
break them even more. Sometimes they may be disabled for some specific
reason, and we don't want to increase the set of reasons without
noticing.
To help solving this problem, this commit adds some helper functions
that should make it easier to change certain i915.ko parameters and
then restore their original values at the end of the test. With this,
I'm hoping QA will be able to detect any regressions and automatically
bisect them - or, with PRTS, reject the patches before they are even
merged.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
v2:
- add a subtest for uncached mappings too for LLC platforms where the
default is cached mapping (Chris)
Signed-off-by: Imre Deak <imre.deak@intel.com>
automake 1.14 was complaining here:
overlay/Makefile.am:44: warning: source file 'x11/x11-window.c' is in a
subdirectory, but option 'subdir-objects' is disabled.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Function check_gpu_ok checks to make sure that any hangs
have cleared by testing for (flags == 0). Some tests set
the STOP_RINGS_ALLOW_BAN and STOP_RINGS_ALLOW_ERRORS flags
but these do not get cleared by an individual ring reset,
(a feature added recently to the driver), leading the
check_gpu_ok function to think that the gpu is still hung.
So I mask the flags with STOP_RING_ALL, to ignore the mode
bits and look only at the bits that stop the rings.
Once gpu_check_ok sees that the gpu is not hung I write 0
to stop_rings in order to clear it completely. This is
because igt_set_stop_rings will only write to stop_rings
if either a) they are currently 0 or b) we are writing 0.
If we leave the mode bits set then subsequent calls to
igt_set_stop_rings to create hangs will fail.
Signed-off-by: Tim Gore <tim.gore@intel.com>
During the streaming setup, we execute a dummy batch in order to bind
the objects into the GTT and query their offsets. For this, we should
not use a snooped buffer for the dummy batch, or else we may anger the
GPU. Given that we have a choice, use the other buffer for the dummy
batch.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Current userptr kernel implementation downgrades tracking VMA ranges (real
userspace ones) to an inefficient linear walk for any process which has
instantiated overlapping userptr objects.
This adds a test which shows the performance cliff on, most visibly, generic
userspace mmap(2) and munmap(2) operations between unsync, non-overlapping
and overlapping userptr objects.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Thomas Daniel <thomas.daniel@intel.com>
The llc cpu path only partially mapped the batch buffer so confused the
CS when attempting to execute an empty batch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90809
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Currently the test expects to find 15 stereo 3D modes, however the
number of stereo modes we get from the current kernel EDID parser
is actually 13.
The extra two modes we had previously were GTF modes, which are no
longer getting added by the kernel since we have corresponding
CEA/DMT modes available. So having the GTF modes in the list was
not actually intentional.
The kernel commit that change the behaviour:
commit bfcd74d2aeda25a78f7cc92f80650218b1bce0ca
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date: Thu Apr 2 17:02:11 2015 +0300
drm/edid: Add DMT modes with ID > 0x50
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90368
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
This is a basic sanity test of the backlight sysfs interface.
v2:
- Add jani's suggestion for immediate readback
- Remove unused parameter from test_and_verify()
- Add fade test
Issue: VIZ-3377
Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
This patch utilizes piglit's new --no-retry option. That option
prevents incomplete tests from being retried when resuming a
test run. This is necessary because retrying tests that cause
a crash or reboot prevents a test run from being resumed.
This patch also adds -s to the piglit command line. The -s option
forces test logs to be synced to disk after every test.
Without it, some logs can be lost if a test causes a crash
or reboot, making it impossible to resume the test run at the
correct point.
Signed-off-by: Mike Mason <michael.w.mason@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
fatal_signal_handler() was trapping fatal errors but not
flagging the test as failing or setting an exit code.
The result was that the test would return Ok or Skipped
depending on what the other subtests did even though one
of the subtests had segfaulted.
Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This removes unnecessary 'struct per_thread_data' and avoids the
compilation error 'variable length array in structure extension
will never be supported' by clang. The bug entry is
https://code.google.com/p/chromium/issues/detail?id=476001
Cc: Benjamin Widawsky <benjamin.widawsky@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Yunlian Jiang <yunlian@google.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Add a make file for android so the unit tests can be built.
Enabled asserts for the library code so the unit test behaviour
is correct.
Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
commit 1e8df16778b0d8fd8102b3ee799b028f8f961089
Author: Sonika Jindal <sonika.jindal@intel.com>
Date: Wed May 20 13:40:48 2015 +0530
drm/i915/skl: Swapping 90 and 270 to be compliant with Xrand
Changed the rotation direction so IGT needs to be told.
Reviewed-by: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Be clean and use memset(0) on ioctl args before use and downgrade some
of the lesser informatic messages to just debug.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The test checks the residency in a given RC6 state or any deeper states
that are also enabled. For example the RC6 subtest checks the combined
residency in RC6/RC6P/RC6PP. Since the kernel reported value for the RC6
residency doesn't include the RC6P or RC6PP residency we need to adjust
the RC6 value accordingly. A similar adjustment is needed for the RC6P
subtest.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90369
Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Currently the test runs a separate idle loop when reading out each RC6
counter. But there is no need for this, we can have a signle idle loop
and read out all the counters at once.
This prepares for an upcoming patch where we need to consider the RC6P
and RC6PP counters as well when checking RC6.
Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
The way the test checks for the RC6 enabled mask atm doesn't work:
calling igt_success outside of any subtests doesn't have any effect.
This means the test will run a 11 second idle loop for each RC6 state
regardless if the platform supports these or have them enabled. Fix this
by checking explicitly if a given RC6 state is enabled before reading
out/checking the corresponding counter.
With this fix we can also get rid of the GEN6/IVB checks, since the RC6
mask check makes them redundant. We still need the VLV/CHV checks, since
media RC6 doesn't have a separate bit in the mask.
Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
The upcoming patches will add some additional logic around reading out
the counter values, so factor out the readout code to prepare for those
patches.
No functional change.
Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
The counter check function (residency_accuracy) cares only about the
counter delta, so no need to pass it the start/stop values separately.
Simplify things to prepare for the upcoming patches.
No functional change.
Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
The temporary vars only obfuscated things, so get rid of them. Also
remove some redundant asserts and info messages.
The only functional change is that the counter delta will be checked
only against a percentage based accuracy range (90%-100%) and not
against a hard-coded limit (RC6_FUDGE). The two checks serve the same
purpose and the former one is clearer.
Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
If ANDROID_HAS_CAIRO is not set, automatically add all
kms tests to the skip_tests_list.
Building for android currently fails due to the addition of
new kms tests. Rather than just adding the new tests to the
exclusion list, autogenerating a list of all kms tests and
excluding them will reduce future maintainance.
Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
The CRC debug interface is a bit more than a simple textual file in
debugfs as there are a small command language to control what we want
from them.
This tool starts, slowly, by allowing us to dump the pipe CRCs whenever
we want. It can be handy to check what is the current CRC when we reach
a certain state on the screen (when using --interactive-debug for
instance) against a known CRC.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
It can be useful to have one of those to carry state between the handler
parsing the options and the rest of the test. Right now the only thing
we can do is to use global variables for that.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Fix various typos, add missing parameter documentation, include the
igt_draw section and update the list of ignored headers.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
On android with small memory footprints gem_cpu_reloc can fail
due to OOM.
Refactor gem_cpu_reloc into 2 tests, a basic test which performs
10 relocations and a full test which skips if there is insufficient
memory.
Changed the memory required test to better estimate the actual
RAM used.
v2: Addresed comments from Thomas Wood
Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Now we get the reference CRCs on separate untiled FBs just to make
sure FBC is not there to mess the CRC computation. We also get the
reference CRCs for buffers that were drawn in the same way that we
draw them during the tests, so we can finally get rid of that FIXME
comment we have!
With this, kms_fbc_crc now actually tests something instead of just
wasting CPU cycles...
Fixes regression introduced by:
commit 562bbe12f6fb75811a746c742a28d32a17b26aa9
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Fri Feb 27 22:04:18 2015 +0100
tests: Remove usage of igt_crc_equal and _non_null
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Just like we have fill_render() and fill_blt(). I'm also going to use
fill_mmap_gtt() for the code that generates the reference CRCs.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
... as the other drawing tests: single white pixel at top/left of the
screen, instead of painting the whole screen blue.
This will make it much easier to fix the CRC checking code.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
To remove some duplicated code. When we finally fix that FIXME, the
code will get a little bigger too.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Just a small simplification to make the code a little easier to
understand, and to help us when we further split drawing vs flipping
later.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Now that we moved to the frontbuffer tracking scheme, it may take a
long time for FBC to be updated after it is invalidated: 300ms is not
enough anymore.
The problem starts when i915_gem_execbuffer2() indirectly calls
intel_fb_obj_invalidate(), which disables FBC. After this, FBC only
gets reenabled when i915_gem_retire_work_handler() happens and
indirectly calls intel_frontbuffer_flush(). Notice that while FBC is
not yet enabled, the screen contents are correct, so this shouldn't
really be a bug.
Previous versions of this patch were replacing the gem_bo_busy() calls
with gem_sync(), but after some discussion we concluded this was not
the correct way to handle the problem, so let's just increase the
timeout so we can kill those subtest failures.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
So make sure that, at prepare_test(), we wait for FBC to be enabled
again after we run the exec_nop() call. Since after this happens, we
just assert fbc_enabled() at test_crc() instead of waiting for it to
be enabled.
This is now needed because we moved to software frontbuffer tracking,
so it can take some considerable time for FBC to be reenabled after it
is disabled.
A previous version of this patch was just calling gem_sync() after
exec_nop().
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Let's just steal the "crc" namespace and add this by default to
igt_pipe_crc_collect_crc() instead of adding more calls to other
tests. If tests want special waits on just some of their collect_crc()
calls, they can use another name instead of "crc".
This is very useful when developing, especially when the CRC we get is
wrong: we want to look at the screen to see what's going on before we
can think about how to fix the problem. So let's add this to the lib
instead of adding this to every single test I need to debug.
v2: Add some documentation (Daniel).
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
i-g-t now creates a single combined test list for tests with
and without subtests. This patch adapts run-tests.sh to that
change.
Signed-off-by: Mike Mason <michael.w.mason@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
The tool I used to generate that list doesn't support expanding the list
of registers when dealing with something like CUR_WM_A_*. Expand it by
hand for now (tm).
Remove CUR_PAL_${pipe}_* for the same reason (and because it's not very
useful to have).
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>