919 Commits

Author SHA1 Message Date
Xiang, Haihao
641267dd73 tests: add gem_media_fill
It is to check whether media pipeline on render ring works. Codes
are copied and modified from the rendercopy case which uses 3D pipeline.
However media pipeline is simpler than 3D pipeline and there is few changes
between gen6,gen7 and gen8

Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2013-12-06 15:11:03 +08:00
Ben Widawsky
8ac7b93b21 gem_exec_faulting_reloc: Update gen8 BLT cmds
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-12-05 16:28:20 -08:00
Ben Widawsky
53b0c0431c gem_reloc_vs_gpu: Update for gen8 BLT cmds
NOTE: Some subtests are still failing, but I haven't found the bug yet.
At least this should help QA meanwhile.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-12-05 15:32:37 -08:00
Ben Widawsky
b23d73788a gem_persistent_relocs: Update for gen8 BLT cmds
NOTE: Some subtests are still failing, but I haven't found the bug yet.
At least this should help QA meanwhile.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-12-05 15:32:22 -08:00
Ben Widawsky
ba0d651a01 gem_write_read_ring_switch: Missed gen8 BLT updates
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-12-05 14:36:20 -08:00
Ben Widawsky
846a0f01b0 drm_vma_limiter_cached: Missed gen8 BLT updates
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-12-05 14:34:35 -08:00
Ben Widawsky
672911d714 gem_pipe_control_store_loop: BDW update
I've opted to not use the PIPE_CONTROL w/a for now. I am unclear if it
is actually required (the test does pass).

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-12-05 14:30:14 -08:00
Daniel Vetter
40b586188c tests/gem_ctx_exec: Add eviction test
It didn't pan out at all since atm we don't evict context objects. But
maybe it's useful for when that happens.

v2: Actually test eviction. Took a while to figure that one out.

And indeed the testcase now fails because we don't evict the previous
context as we should.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-05 15:50:43 +01:00
Daniel Vetter
33ef528490 tests/core_get_client_auth: new subtests for always authenticated
This exercise the bug fixed in

commit 1020dc6990168a5081ffad620c440e220f05b460
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Oct 29 08:55:57 2013 +0000

    drm: Do not drop root privileges for a fancier younger process

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-05 13:41:51 +01:00
Daniel Vetter
365f4812b1 tests: rename get_client_auth to have a core_ prefix
Also sort .gitignore.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-05 13:35:50 +01:00
Mika Kuoppala
6b18ef826f tests/gem_reset_stats: add close-pending-fork
This triggers use after free oops on request->batch_obj when
going through the rings and setting reset status on requests,
after a gpu hang.

v2: Streamlined the test and added comments (Daniel)

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-04 16:45:28 +01:00
Tvrtko Ursulin
4f990f3ad2 build: Skip kms_fbc_crc on Android
We do not have GLib there so it does not build.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-03 17:48:03 +01:00
Tvrtko Ursulin
b92b397d5e build: Make sure asserts are enabled for tests
Tests depend on assertions being enabled since they can, and do,
contain actual test steps. They are also mandatory for ensuring
sane test case behaviour.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-03 17:08:03 +01:00
Daniel Vetter
aee0dcb1ec test/gem_concurrent_blt
Limit working set size also with available ram.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72255
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-03 16:32:52 +01:00
Damien Lespiau
e7ec90a01c gitignore: Ignore kms_fbc_crc
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-11-28 14:35:45 +00:00
Damien Lespiau
8d7f00146c kms_fbc_crc: Remove unused variable
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-11-28 14:34:51 +00:00
Ville Syrjälä
6c9fcc42bb kms_fbc_crc: Add a CRC based FBC test
kms_fbc_crc will perform various write operations to the scanout buffer
whilc FBC is enabled. CRC checks will be used to make sure the
modifcations to scanout buffer are detected.

The operations include:
 - page flip
 - GTT mmap
 - CPU mmap
 - blit
 - rendercopy
 - context switch + rendercopy
 - combination of a page flip and each operation listed above

v2: Use gem_sw_finish instead of drmModeDirtyFB after CPU access
v3: Drop pwrite tests, call gem_bo_busy() after rendering, drop
    set_domain() calls after mmap access, wait for 2 vblanks

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2013-11-27 16:21:28 +02:00
Ville Syrjälä
49f4860d5c lib: Add gem_bo_busy
Move gem_bo_busy() from gem_wait_render_timeout.c to lib.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2013-11-27 16:21:28 +02:00
Ville Syrjälä
725da6ee74 rendercopy: Pass context to rendercopy functions
rendercopy does the batch buffer flush internally, so if we want
to use it with multiple contexts, we need to pass the context
in from caller.

v2: Modify rendercopy_gen8 as well

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2013-11-27 16:21:28 +02:00
Ville Syrjälä
3d371a7284 kms_cursor_crc: Fix crc readout after a subtest failure
If a subtest fails, it'll leave the pipe CRC file open, which will
prevent subsequent subtests from opening the file. Make sure the file
is cloesed before trying to open it again.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2013-11-27 16:20:09 +02:00
Daniel Vetter
6720dd4b2c tests: Document exec naming convention for execbuf related tests
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-27 11:31:12 +01:00
Daniel Vetter
aa4ff912e3 tests: Document per-ring naming conventions
Inspired by the recent pile of tests for the CS, which doesn't split
up the tests into per-ring subtests.

Cc: bradley.d.volkin@intel.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-27 11:14:19 +01:00
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
Mika Kuoppala
6de398888e tests/gem_reset_stats: check non root access to reset_stats
Getting global reset count needs to be tested with root and
non root access.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-20 21:31:04 +01:00
Mika Kuoppala
2dd312cbb8 tests/gem_reset_stats: stop rings after injecting hang
To make driver report a simulated hang in dmesg.

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-20 21:29:04 +01:00
Mika Kuoppala
0afe006eac tests/gem_reset_stats: add support for BDW+
For BDW+, there BATCH_BUFFER_START is 3 * 32bits in length and
length needs to be encoded into the opcode.

Suggested-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-20 21:28:25 +01:00
Daniel Vetter
4fd0458be2 tests/gem_reset_stats: More macros!
Instead of freaking out about negating the skip condition and punting
I could have remembered that I've solved this already ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-20 16:07:30 +01:00
Daniel Vetter
ff193614b2 tests/gem_reset_stats: Use macros a bit more
Just demonstration really.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-17 17:31:19 +01:00
Damien Lespiau
36786e4a04 gitignore: Ignore gem_reset_stats
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-11-15 07:03:33 +00:00
Daniel Vetter
b5bfdbb1ad tests: More bdw fallout
This time misplaced parens.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-15 00:10:52 +01:00
Daniel Vetter
df5e880bea tests: More bdw fallout 2013-11-14 23:31:43 +01: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
Ben Widawsky
c37e9cf0c4 gem_cs_prefetch: more gen8 integration fallout
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-11-13 18:23:06 -08:00
Ben Widawsky
9ef6769366 gem_evict_*: Fix batch lengths, broken on gen8 integration
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-11-13 13:30:26 -08:00
Mika Kuoppala
1ff7427578 tests: add gem_reset_stats
v2: check the ioctl pad and flag parameters

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-13 11:55:26 +01:00
Oscar Mateo
76c78c0aae build: New Android makefiles
These form the basis of the new Android build system.

v2: As suggested by Daniel Vetter, modify compilation flags to
not error on return-type and not warn on sign-compare.

Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-12 12:16:31 +01:00
Oscar Mateo
dce0d99a91 tests/gem_vmap_blits: Finish extracting gem_read
It seems something escaped this commit:

commit bd5cf9a07d17ce91dfaa3aa12d3f2c93815f0489
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Tue Jan 10 15:37:53 2012 +0100

    lib/drmtest: extract gem_read

Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-12 12:05:27 +01:00
Oscar Mateo
7076ea1bd6 tests/drm_get_client_auth: In Android, use gettid() instead of syscall(SYS_gettid)
Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-12 12:05:15 +01:00
Oscar Mateo
1cd6913608 rendercopy: Remove rendercopy.c
Move scratch_buf_write_to_png() to its only user, gem_render_copy.c.
This makes the cairo dependencies easier to handle from the Android
perspective, but if there is a good reason why this file exists I can
try to handle it differently.

Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-12 12:04:45 +01: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