1959 Commits

Author SHA1 Message Date
Paulo Zanoni
bfea74a9f6 kms_frontbuffer_tracking: add fliptrack subtest
The current upstream Kernel code stops and then restarts FBC at every
page flip. I am working on patches to keep FBC enabled all the time,
so this brings the possibility of having the hardware tracking
mechanism looking at the old buffer instead of the new one. This test
should catch this problem.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-08 15:02:50 -03:00
Paulo Zanoni
f0c067ddb3 kms_frontbuffer_tracking: don't mode unset when checking sink CRC support
There's no reason to do a mode unset since we don't care about whether
FBC or PSR are enabled or disabled. This should save about a second
for each time you invoke the program.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-08 15:02:30 -03:00
Paulo Zanoni
c1daf330e9 kms_frontbuffer_tracking: add scaledprimary subtest
It's not testing a lot since we lack the Kernel Stolen Memory Checker,
but some day this will be useful.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-08 15:02:06 -03:00
Paulo Zanoni
bb2ebe92ef kms_frontbuffer_tracking: set the universal planes cap in the setup
... instead of just setting it for the fullscreen_plane subtest and
then unsetting it. We want to use it more, so just make sure all the
code knows how to deal with multiple planes per CRTC.

This also allows us to do some upfront caching of the plane
information, so the code for the tests gets simpler.

There's a new test that's going to use all these changes.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-08 15:01:46 -03:00
Paulo Zanoni
68cb0de70c kms_frontbuffer_tracking: change pattern 1's last rect to 1x1
Make sure the tracking mechanism is able to track a write in the very
last pixel.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-08 15:01:20 -03:00
Daniel Stone
bbd193b478 tests: Add blob-property test
Exercises the new blob-creation ioctl, testing lifetimes and behaviour
of user-created blobs, as well as exercising all the invariant
conditions we guarantee from modes exposed as blob properties.

v2: Renamed to core_prop_blob, skip test if blob not available.
v3: No changes.
v4: Consistently return 0/errno.
v5: Use do_ioctl_err and igt_assert_fd.
    Use igt_assert_*() helper macros rather than direct igt_assert().

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Daniel Vetter <daniel.vetter@intel.com>
2015-10-07 17:57:27 +01:00
Ville Syrjälä
983dfe5b68 tests/pm_rc6_residency: Measure the sleep duration
The code is confused about the units of CODE_TIME. The comment
says 50 microsseconds, but the actual code makes it 50
milliseconds. Avoid the whole mess by measuring the sleep
duration ourselves. Since the time measurement is taken around
the whole operation it obviously includes a bit of extra, but
at least it's much less than the fixed 50 ms.

For instance on one VLV board I now get something like this:
- Residency in rc6 or deeper state: 3002 ms (ratio to expected duration: 0.98)
+ Residency in rc6 or deeper state: 3001 ms (sleep duration 3003 ms) (ratio to expected duration: 1.00)
so the reported ratio is now much closer to reality.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-09-28 18:23:52 +03:00
Ander Conselvan de Oliveira
571942f0c4 testdisplay: Fix segfault after first modeset fails
When testing all modes on a connector with a single mode, if the modeset
fails, the code attempts to remove fb_info[-1], because old_fb still has
the inital value of -1.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90625
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-25 11:42:14 +01:00
Thomas Wood
6c89204da7 lib: add igt_debugfs_search
Add igt_debugfs_search to search each line in a debugfs file for a
specified substring.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-24 14:24:18 +01:00
Tvrtko Ursulin
1ea96af776 gem_ppgtt: Test VMA leak on context destruction
Test that VMAs associated with a context are cleaned up when
contexts are destroyed.

In practice this emulates the leak seen between fbcon and X server.
Every time the X server exits we gain one VMA on the fbcon frame
buffer object as externally visible via for example
/sys/kernel/debug/dri/0/i915_gem_gtt.

v2: Use igt_debugfs_open, getline and strstr instead of home-brewed
string matching. (Thomas Wood)

v3: Rebase for drm_open_driver.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-24 14:24:18 +01:00
Thomas Wood
9edf293c45 gem_storedw_loop: fix segfault when listing subtests
Commit fb66cd5 (tests/gem_storedw_loop: Fix use after free for bufmgr)
introduced a segmentation fault when listing subtests because
drm_intel_bufmgr_destroy is called with NULL. Move this and the call to
the close function inside an igt_fixture block to prevent them being
called when listing subtests.

Cc: Robert Beckett <robert.beckett@intel.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-24 11:04:34 +01:00
Robert Beckett
fb66cd5c34 tests/gem_storedw_loop: Fix use after free for bufmgr
Move bufmgr destruction to end of tests. This avoids use after free on
successive tests.

This could be squashed with the following patch to aid bisectability:

commit 0679702150157706a6def66b893b29c16345f4db
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Wed Aug 5 16:06:31 2015 -0700

    tests/gem_storedw_loop: add new store_dword test to unify per-ring ones v2

Signed-off-by: Robert Beckett <robert.beckett@intel.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-23 18:00:46 +02:00
Daniele Ceraolo Spurio
a16704261f tests/gem_ctx_param_basic.c: fix non-root-set-no-zeromap subtest
The test expects an ioctl failure when it tries to set
CONTEXT_PARAM_NO_ZEROMAP from a non-root process. However, there is no
requirement in the kernel for the user to be root to set this parameter,
so the test is failing (it never passed as far as I'm aware of).
Fix the test by making it expect a successful ioctl completion.

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-18 17:31:36 +01:00
Micah Fedke
2111173083 tests: update core_getstats to run on any platform
Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11 14:39:43 +01:00
Micah Fedke
fd282fb9d4 tests: update core_getclient to run on any platform
Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11 14:39:43 +01:00
Micah Fedke
75c9e92efb tests: update core_getversion to run on any platform
Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11 14:39:43 +01:00
Micah Fedke
253544f7a3 tests: update core_get_client_auth to run on any platform
Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11 14:39:43 +01:00
Micah Fedke
c81d293aed convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocci
Apply the new API to all call sites within the test suite using the following
semantic patch:

// Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls
@@
identifier i =~ "\bdrm_open_any\b";
@@
- i()
+ drm_open_driver(DRIVER_INTEL)

@@
identifier i =~ "\bdrm_open_any_master\b";
@@
- i()
+ drm_open_driver_master(DRIVER_INTEL)

@@
identifier i =~ "\bdrm_open_any_render\b";
@@
- i()
+ drm_open_driver_render(DRIVER_INTEL)

@@
identifier i =~ "\b__drm_open_any\b";
@@
- i()
+ __drm_open_driver(DRIVER_INTEL)

Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11 14:39:43 +01:00
Ander Conselvan de Oliveira
6eed1b5eb4 kms_addfb_basic: Require fb modifiers for unused field tests
The drm core doesn't check unused fields of ADDFB2 for pre-FB_MODIFIERS
userspace, so use igt_require_fb_modifiers(). Also, the size of the
ioctl changed with the addition of the modifiers, so it is necessary to
use the LOCAL_ version of it, otherwise some data may get truncated.

v2: Improve commit message. (Thomas)
    Remove one spurious change to use LOCAL_DRM_IOCTL_ADDFB2. (Thomas)

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08 16:15:16 +01:00
Daniele Ceraolo Spurio
2269997cff tests/gem_bad_reloc: use correct page table size
2 subparts of gem_bad_reloc check that the reloc address is below the
global gtt boundary. However, when executing from ppgtt the reloc
address can be greater than that and still be a valid address.

To be sure that we're using the right upper limit, select it based on
the ppgtt mode.

Cc: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08 16:15:16 +01:00
Thomas Wood
b04691b3e8 tests/gem_pwrite_snooped: disable const cast warning
Disable -Wcast-qual temporarily to allow memchr_inv to return non-const
data (similar to memchr), without causing a compiler warning.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08 16:15:16 +01:00
Thomas Wood
84cfa9e4d2 tests: remove gem_storedw_loop_* tests
These have been replaced by subtests in gem_storedw_loop.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-08 16:15:16 +01:00
Thomas Wood
2142a15d49 tests/gem_storedw_loop: remove redundant ppgtt check
All tests require ppgtt, so checking for it later on has no effect.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08 16:14:45 +01:00
Thomas Wood
673aab8a0a tests/gem_storedw_loop: skip on gen6 bsd
MI_STORE_DATA is broken on gen6 bsd.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08 16:14:45 +01:00
Thomas Wood
4ee6709e3b tests/tools: add --as-needed to linker flags
Add --as-needed to the linker flags to reduce the number of shared
library dependencies, since not all the tests and tools use all the
libraries required by the helper library (for example, many tests do not
use cairo). This helps portability of the binaries and also makes a
very small improvement to the execution speed and memory consumption.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08 16:14:45 +01:00
Ander Conselvan de Oliveira
4c63f54de9 gem_storedw_loop: Skip test if device doesn't have requested ring
The VEBOX ring is not available in generations before Haswell, so make
tests that use it skip instead of fail in previous gens.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-25 17:20:14 +01:00
Tim Gore
d3d56bf2af tests/gem_ctx_exec.c: only hang the ring we are testing
In the reset-pin-leak test we were calling
igt_set_stop_rings(STOP_RING_DEFAULTS) which sets the
stop_rings bits for all gpu engines. But we only submit
work to the render engine. When TDR is enabled (as it is
in Android currently) only the render engine gets reset,
which clears the stop_rings bit for the render engine but
not for the other engines. This causes the test to fail on
the second iteration because stop_rings is not clear.

So just set the stop_rings bit for the engine we are going
to hang, namely the render engine.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-25 17:20:14 +01:00
Paulo Zanoni
71b85f9713 kms_frontbuffer_tracking: print the status when it's not what we expect
Printing the status on an unexpected failure is always the first thing
I do. So do this always.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-25 11:36:01 -03:00
Paulo Zanoni
a07d0a47be kms_frontbuffer_tracking: add slow_draw() subtest
It fails on my SKL machine.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-25 11:35:30 -03:00
Paulo Zanoni
229110442a kms_frontbuffer_tracking: wait for PSR to be HW Enabled & Active
Make sure PSR is fully there.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-25 11:34:56 -03:00
Paulo Zanoni
c1fe951b8a kms_frontbuffer_tracking: add options for setting the shared fb X/Y
I'm using this to debug some aspects of the GTT tracking.

While at it, do a small rename and fix the ASCII art.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-25 11:34:28 -03:00
Thomas Wood
804e11f40d lib: add a single include header
Add a header that includes all the headers for the library. This allows
reorganisation of the library without affecting programs using it and
also simplifies the headers that need to be included to use the library.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21 09:37:10 +01:00
Mika Kuoppala
c37b235202 tests/drv_hangman: Adjust to 64bit bb offsets
commit e1f123257a1f7d3af36a31a0fb2d4c6f40039fed
Author: Michel Thierry <michel.thierry@intel.com>
Date:   Wed Jul 29 17:23:56 2015 +0100

    drm/i915: Expand error state's address width to 64b

changed the batch buffer address to be 64b. Fix the parsing
of gtt offset accordingly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91638
Cc: Akash Goel <akash.goel@intel.com>
Cc: Michel Thierry <michel.thierry@intel.com>
Reviewed-by: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2015-08-19 12:12:28 +03:00
Paulo Zanoni
64590c7b76 kms_frontbuffer_tracking: reduce the FBC wait timeout to 2s
Just like we did for PSR, let's do it for FBC. FBC gets reenabled in
just 50ms, so the 5000ms timeout is huge. On the other hand, we only
pay the 5000ms timeout full price 9 times when running
kms_frontbuffer_tracking --fbc-only, so this change shouldn't save too
much time.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 19:14:49 -03:00
Paulo Zanoni
f4db3b1884 kms_frontbuffer_tracking: reduce the PSR wait timeout to 2s
PSR only takes up to 100ms to be enabled, but we were using 5000ms
timeouts. The problem with PSR is that the MMAP_GTT tests have to
assert that PSR is disabled and stays disabled during the whole
timeout, so that 5s cost is a little to high when we consider that we
do the full 5s wait 74 times when running kms_frontbuffer_tracking
--psr-only.

By reducing to 2s we still make sure we're safe, since we're waiting
20x the time PSR needs to get reenabled, and we reduce the runtime of
running kms_frontbuffer_tracking --psr-only from 14m10s to 10m29s.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 19:14:26 -03:00
Paulo Zanoni
78120d8158 kms_frontbuffer_tracking: add subtests for rgb565 and rgb101010
Make sure valid formats work properly and invalid formats keep the
features disabled.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 15:33:50 -03:00
Paulo Zanoni
c3fb972ee9 kms_frontbuffer_tracking: fix psr-farfromfence assertions
We're using GTT draws and they disable PSR. This test is mostly for
FBC anyway.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 15:33:26 -03:00
Paulo Zanoni
d675cf3ed7 kms_frontbuffer_tracking: split prepare_subtest() in two functions
And remove duplicated code by calling prepare_subtest_data() on
rte_subtest().

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 15:32:59 -03:00
Paulo Zanoni
6de5b06112 kms_frontbuffer_tracking: remove duplicated pairs on multidraw
If we already tested the combination of m1+m2, don't test m2+m1 later:
the drawing pattern used already has 4 squares, so we're already
testing the "m2 followed by m1" case.

This should reduce the test time from about 60s to about 30s.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 15:32:36 -03:00
Paulo Zanoni
a2904ead74 kms_frontbuffer_tracking: SKIP if not enough stolen is available
This is not an FBC bug.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 15:32:12 -03:00
Paulo Zanoni
f62a683acd kms_frontbuffer_tracking: use all drawing methods on multidraw_subtest
Instead of having a single pair of methods per subtest. Having this in
pairs is not very useful since we end doing all the drawing methods
per subtest anyway.

This saves a few modesets, which makes eDP slightly faster - about 22s
on my local machine.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 15:31:44 -03:00
Paulo Zanoni
b53bcf789b kms_frontbuffer_tracking: improve support for multiple pixel formats
We now have per-pixel-format FBs and CRC values. Also t->format to
indicate the format we're using on the subtest. We still only use the
default RGB888 format (AKA FORMAT_DEFAULT) for all tests since
multiplying the current number of tests by the number of new pixel
formats doesn't sound like a great idea.

With this, it should be really easy to add new tests that use
different pixel formats.

Also, if you want a full IGT run on a specific pixel format, all you
need to do is to change FORMAT_DEFAULT.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 15:31:22 -03:00
Paulo Zanoni
3b17600789 kms_frontbuffer_tracking: add information about more formats
We're not using those formats yet, but a simple change to create_fb()
allows us to use these formats without problems now.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 15:30:56 -03:00
Paulo Zanoni
606f039dec kms_frontbuffer_tracking: introduce enum color
We want to add support for different pixel formats and the current
hardcoded pixel values won't work with that. So add enum color and
its auxiliary functions so we can decide the pixel values based on the
chosen color enum.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 15:30:28 -03:00
Paulo Zanoni
7009b10c42 kms_frontbuffer_tracking: don't pass the format to create_fb()
It is create_fb() who is going to decide the buffer format based on
the arguments provided by the caller. This is another step for the
non-XRGB8888 support.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 15:30:07 -03:00
Paulo Zanoni
e4b94900b5 kms_frontbuffer_tracking: add a wrapper for igt_create_fb()
The wrapper will do a few additional things when we add support for
formats different than XRGB8888.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 15:29:18 -03:00
Paulo Zanoni
445182f26b kms_frontbuffer_tracking: fix MMAP_WC assertions on PSR
Now that the MMAP_WC operations call the dirty ioctl, PSR gets
reenabled after some time. So we have to adjust op_disables_psr() to
take that into account.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 15:28:49 -03:00
Paulo Zanoni
caaf3b869f lib/igt_draw: add support for RGB565 and XRGB2101010
We need to test those pixel formats on the FBC code, so let's make
sure the drawing library works on them first.

v2: Update the gtkdoc (Daniel).

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14 15:27:19 -03:00
Jesse Barnes
87a5f2d776 tests/kms_setmode: mark simple clone test as basic
Should cover simple, single CRTC mode sets.

Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-14 09:27:33 -07:00
Jesse Barnes
e5839d240a tests/kms_flip: add basic tests for flip, flip vs dpms, and flip modeset v2
Simple variants that don't do multiple output or interruptible testing.

v2: add vblank variant, remove duplication (Daniel)

Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-14 09:27:33 -07:00