1891 Commits

Author SHA1 Message Date
Ville Syrjälä
62426feec5 tests/kms_pwrite_crc: Use drmModeSetPlane() instead of igt_plane_set_fb()
igt_plane_set_fb()+igt_display_commit() have too much overhead, and that
causes the cache to get flushed before we flip, making the test
useless, at least on machines with small LLC. Switch to
drmModeSetPlane() to reduce the chance that the cache gets flushed
before we grab the crc.

Still nowhere near 100% reliable on my IVB laptop with 3 MiB LLC,
but at least it can now hit the problem occasioanally. My desktop
IVB with 8 MiB LLC seems to hit it rather reliably.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-08-12 16:24:50 +03:00
Daniel Vetter
adfc294384 tests: Document ABI extension catchers
Our invalid-flags/params testcases are meant to catch abi extensions
by just testing for the next available flag/param. Unfortunately we
need that since without those we forgot to write testcases for these
new flags way too often :(

But it's not entirely clear why this is, so document this trick with
comments.

Also gem_wait wasn't this paranoid, so change the testcase to be so.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-08-12 14:46:46 +02:00
Daniel Vetter
5b0a8433fd lib/core: Add igt_reset_timeout
Convenience wrapper suggested by Chris for igt_set_timeout(0, NULL).

v2: While at it add an empty line in kms_flip to make
set/reset_timeout a visual block.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-08-12 14:46:46 +02:00
Daniel Vetter
370c989723 lib/core: Add optional reason for timeout failure
"Timed out" isn't a terribly informative message, allow users to set
something more informative. Inspired by a request from Jesse.

Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-08-12 14:46:40 +02:00
David Weinehall
24617ef82a tests/gem_ctx_param_basic: support NO_ZEROMAP
Signed-off-by: David Weinehall <david.weinehall@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-08-12 14:42:46 +02:00
Jesse Barnes
db0f28aee8 Revert "tests/gem_ctx_param_basic: fix invalid params"
This reverts commit 0b45b0746f45deea11670a8b2c949776bbbef55c.

We want to check against our local copy of the params so we can at least
potentially catch new flag additions.

Requested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-06 14:35:34 -07:00
Jesse Barnes
0b45b0746f tests/gem_ctx_param_basic: fix invalid params
Use -1 as the invalid param since we've added more since this test was
created, causing expected EINVAL failures to return an unexpected error
code.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-06 13:17:48 -07:00
Paulo Zanoni
995f2738ad lib: add igt_debugfs_read()
A helpful function for when you want to read a whole debugfs file to a
string and don't want to worry about opening and closing file
descriptors and asserting buffer sizes.

We've been using this already for kms_frontbuffer_tracking and
kms_fbcon_fbt, so the only test with new code here is kms_fbc_crc.

Also notice that for kms_fbc_crc we had to increase the buffer size
since the file can sometimes be bigger than 64 bytes - depending on
the reason why FBC is disabled.

Of course, there are probably many other programs we can patch, but
I'm not doing this now.

v2: Add the macro to wrap sizeof() (Daniel).
v3: Add documentation for the macro too (Daniel).

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-05 17:30:58 -03:00
Paulo Zanoni
ffd7321c70 kms_frontbuffer_tracking: use the dirty ioctl after MMAP_WC calls
We can't add this to igt_draw since igt_draw doesn't care whether it's
writing on a frontbuffer or not.

PS: the ENOSYS is for Kernels without the patch implementing the
IOCTL.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-05 17:21:48 -03:00
Paulo Zanoni
cd33b47a47 tests/gem_mmap_wc: don't fail if the Kernel is too old for the getparam flag
Just don't check the drmIoctl() return code: the "if (val)" should be
enough to prevent any problems.

v2: Don't SKIP, just proceed (Chris).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89739
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-05 17:18:45 -03:00
Daniel Vetter
6bd42ce9c7 tests/kms_addfb: Add testcass for garbage in unused planes
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-07-30 20:45:46 +02:00
Chris Wilson
0591af9c76 igt/gem_streaming_writes: Reorder setting EXEC_OBJECT_WRITE
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90944
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-28 20:12:03 +01:00
Chris Wilson
40ebf95163 igt/gem_streaming_writes: Bind into the GTT early
If we are using a streaming GGTT write into the source, we need to
trigger an early fault in order to obtain a mappable offset. This is
required when later we start reserving execbuf object top-down to try
and avoid mappable space!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-28 19:01:41 +01:00
Michał Winiarski
d49a868378 tests/drm_import_export: Add tests for prime/flink sharing races
It is possible to race between unreference of the underlying BO and
importing it from prime_fd/name. Verify that the behaviour of libdrm
is consistent for prime/flink.

v2: more comments in source file, dropped extra whitespace

Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-24 15:55:18 +01:00
Michał Winiarski
fdefdd48f6 tests/gem_reg_read: Extend and check for valid 36b counter
When reading the timestamp register with single 64b read, we are observing
invalid values on x86_64:

    [f = valid counter value | X = garbage]

    i386:   0x0000000fffffffff
    x86_64: 0xffffffffXXXXXXXX

Test checks if the counter is moving and increasing.
Add a check to see if we can use (reg | 1) flag to get a proper 36b timestamp,
shifting the value on x86_64 if we can't.

v2: More iterations of monotonic test, comments, minor fixups (Chris)
v3: Skip tests if reg_read is not supported

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-07-16 13:06:13 +01:00
Chris Wilson
32c898849b igt/gem_eio: Waiting on a hung batch should report -EIO
If we are waiting on a handle, and its request is cancelled due to a
hang, we should report that explicitly through the ABI.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-15 22:09:54 +01:00
Paulo Zanoni
7f952bd976 kms_frontbuffer_tracking: don't keep debugfs open
Make the code smaller and simpler, also ready for when we move
debugfs_read() to lib/.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 15:21:26 -03:00
Paulo Zanoni
1048aa9aa5 tests: add kms_fbcon_fbt
This test should test the interactions between fbcon and the
frontbuffer tracking infrastructure.

Right now the PSR test fails, but as soon as we merge the following
kernel patches, the test wills tart passing:
 - drm/i915: PSR: Flush means invalidate + flush
 - drm/i915: fbdev restore mode needs to invalidate frontbuffer
 - drm/i915: fbdev_set_par reliably invalidating frontbuffer

I didn't want to make this a subtest of kms_frontbuffer_tracking just
because when I wrote it, I really didn't have in mind the fact that
someone might just close the DRM fd in the middle of a subtest.

After this commit we'll have a little bit of duplicated code among
tests. I'll clean this up later.

v2:
  - Refactor the code a little bit.
  - Add the suspend subtests.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 15:20:57 -03:00
Paulo Zanoni
7c5a218cc3 kms_frontbuffer_tracking: implement suspend subtest
Make sure we survive suspend/resume.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 13:06:41 -03:00
Paulo Zanoni
1c389f69f0 kms_frontbuffer_tracking: allow passing a NULL pattern
So we don't need to initialize CRCs we won't use. This makes the
modesetfrombusy and badstride tests a little faster.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 13:06:08 -03:00
Paulo Zanoni
91f097aefa kms_frontbuffer_tracking: simplify subtest enumeration
Just a small bikeshed.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 13:05:40 -03:00
Paulo Zanoni
04d1311fc3 kms_frontbuffer_tracking: add farfromfence subtest
Make sure we notice in case our crtc->y handling is still wrong.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 13:05:12 -03:00
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
4deb562659 configure: require libdrm >= 2.4.55
And drop the now unnecessary universal plane definitions. The 2.4.55
version is already quite old, so we should be fine.

Thanks to Thomas Wood for quickly spotting this.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@>
2015-07-14 12:52:09 -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
9ca8a1bade pm_rpm: remove pm_status_fd declaration
This was forgotten since we moved some code to igt_aux.c a long time
ago.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 09:40:10 -03:00
Matt Roper
b81f7db593 kms_universal_plane.c: Update sanity checks for gen9
SKL and BXT have some new plane capabilities that previous generations
didn't have; we need to update some of our universal plane tests to
expect success rather than failure when running on these platforms.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2015-07-08 13:54:12 -07:00
Abdiel Janulgue
8ad1e40778 tests/gem_exec_params: check invalid flags for Resource Streamer
Make sure resource streamer flags works only in correct ring in
addition to checking next flag after the RS boundary fails.

v2: Make sure we reject RS on pre-hsw.
v3: Don't skip 1<<15 for the exec flags (Jani Nikula)

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-06 10:02:06 +01:00
Damien Lespiau
64295c67e9 build: Add -lm to tests
Since the introduction of igt_stats and its usage in gem_exec_nop, we
need to link the tests against libm. My rebasing bot complained when
linking gem_exec_nop:

  lib/igt_stats.c:492: undefined reference to `sqrt'

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-07-02 11:54:17 +01:00
Chris Wilson
614895fec1 igt/gem_exec_nop: Control boost/idle frequencies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-01 21:02:55 +01:00
Chris Wilson
b43070987e igt/gem_exec_nop: Wait between runs
In order to keep the GPU in a consistent state between samples, we have
to wait for it to fall asleep before proceeding.

For fun hook up igt_stats.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-01 18:58:46 +01:00
Joonas Lahtinen
ad411e2d5d tests/gem_ringfill: Add {render,blitter}-forked-1 subtests.
Add forking subtests to gem_ringfill. Tests cause consistent GPU
hangs on SKL.

v2: Removed noop parts.
v3:
- Allow executing the tests in order too (Chris Wilson).
- Rename the tests to -forked-1

Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
[ickle: Extend to cover forked-N]
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89959
2015-06-29 11:41:06 +01:00
Chris Wilson
f78574101f igt/gem_fenced_exec_thrash: Tidy testing of expected execbuf errors
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-26 11:49:38 +01:00
Derek Morton
c69b135783 igt/gem_fenced_exec_thrash: Fix memory leak between tests
gem_fenced_exec_thrash was not freeing any resources between
subtests. On 1Gb android systems this resulted in the test
failing with an OOM error.

Added cleanup code to free BOs at the end of each subtest.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
2015-06-26 11:49:38 +01: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
Daniel Vetter
484e27542d tests/kms_fbc_crc: Don't force fbc on old platforms
It's simply a bit too scary on pre-gen6 and imo not worth the bother
really until someone starts to implement all the hacks an w/a required
on these platforms. On later platforms the issues are just with
correctness and performance hence no risk for hanging machines.

Cc: Paulo Zanoni <przanoni@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-06-25 09:43:55 +02: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