3528 Commits

Author SHA1 Message Date
Daniel Vetter
09b8211d41 lib/ioctl: Add gem_context_destroy helpers
We also need a raw version for some tests.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13 09:35:35 +01:00
Daniel Vetter
8d21b39251 lib/ioctls: make gem_context_set/get_param infallible
We have separate require checks already, so these failing is a bug in
the test logic.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13 09:35:35 +01:00
Daniel Vetter
15801b4dad igt/ioctls: doc for gem_mmap
Just spotted while driving around. gtkdoc needs the full parameter
list otherwise it doesn't recognize it as a function. So add them.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13 09:35:35 +01:00
Daniel Vetter
a3e34ce258 lib/ioctl: gem_ prefix for igt_require_mmap_wc
We stick to the overall prefix even for magic require functions.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13 09:35:35 +01:00
Daniel Vetter
c18b2d57a9 lib/ioctl: api polish for gem_context_has_param
Just push the igt_require down to align with the usual style.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13 09:35:35 +01:00
Daniel Vetter
c66b2425e7 lib/gt: api polish for igt_can_hang_ring
Align with common igt library style:
- Push the igt_require into the function.
- Push the intel_gen into the function.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13 09:35:35 +01:00
Matt Roper
9ca2cc12b4 kms_cursor_crc: Kernel now checks for integer overflow
As of kernel commit

    commit a679064a7e9e8799177a64a31668a34a1bc6a4f1
    Author: Matt Roper <matthew.d.roper@intel.com>
    Date:   Fri Jan 30 16:22:37 2015 -0800

        drm/i915: Switch planes from transitional helpers to full atomic helpers

the kernel now checks for cursor coordinates that would result in
integer overflow and returns -ERANGE, similar to the checking that was
already done for other plane types.  We update kms_cursor_crc here to
reflect this small behavior change:
 * Check for success at extreme boundary conditions INT_MAX-{width,height}
   rather than INT_MAX
 * Add new check for success at SHRT_MAX; if the driver were to
   internally use short values and overflow, we could have the cursor
   reappear on the screen.
 * Add a test for failure with proper error code at INT_MAX-{width,height}+1

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2015-02-10 09:20:39 -08:00
Ben Widawsky
9846e7f2c5 gem_render_copy: Provide an all pixels check
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Imre Deak <imre.deak@intel.com>
2015-02-09 14:20:44 -08:00
Thomas Wood
38a0c41340 lib/tests: check that invalid subtest names are rejected
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-09 14:39:41 +00:00
Thomas Wood
f0516f3d35 lib/tests: verify subtest enumeration output
Check that the subtest list is not empty if using --list-subtests
returns with an exit code of 0, and that the list is empty if it returns
with 79.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-09 14:39:41 +00:00
Thomas Wood
16cfa37a50 lib: add exit status message to simple tests
Add an exit status message to simple tests, similar to the one printed
for subtests. This includes the test outcome and the time taken to run
the test.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-09 14:39:41 +00:00
Thomas Wood
9942a40437 lib: add subtest start and exit status code messages to debug output
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-09 14:39:41 +00:00
Thomas Wood
2b05ecfb06 lib: validate subtest names
Subtest names should only contain '-', '_' and alphanumeric characters.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-09 14:39:41 +00:00
Thomas Wood
61737903ad lib: print warning and critical messages when listing subtests
These messages are sent to stderr and could indicate an issue when
enumerating subtests.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-09 14:39:41 +00:00
Thomas Wood
a228223ffa lib: warning messages should be sent to stderr
This is a regression from commit df11a0f (lib: add a critical warning
level).

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-09 14:39:41 +00:00
Michał Winiarski
bef692d9f3 tests/gem_userptr_blits: Race between close and invalidate
It was possible for invalidate range start mmu notifier callback to race
with releasing userptr object. If the object is released prior to
taking a spinlock in the callback, we'll encounter a null pointer
dereference.

v2: Moved expressions inside igt_assert(), added mem barrier (Chris)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-04 10:29:12 +01:00
Imre Deak
87edb51940 rendercopy/gen9: fix gem_render_copy 3d state setup
Without emitting the default 3DSTATE_WM_DEPTH_STENCIL state the test
will fail.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2015-02-02 15:27:10 +02:00
Thomas Daniel
51d87b8049 tests/prime_self_import: further fix object counts
A previous commit:

commit 2f2c491cf3167befe7c79e4b17afb4f6284dfc84
Author: Mika Kuoppala <mika.kuoppala@intel.com>
Date:   Fri Mar 28 10:52:46 2014 +0200

    lib/drmtest: don't dup quiescent fd

introduced a regression for drm object leak checking.  A following commit:

commit 8741c2289f17e9bcb740a01cad4764a71c918eea
Author: Mika Kuoppala <mika.kuoppala@intel.com>
Date:   Wed May 7 16:46:19 2014 +0300

    tests/gem_flink_race,prime_self_import: fix object counts

fixed the regression for some cases but missed the export-vs-gem_close-race
subtest.  Note that test behaviour depends on whether the subtest is run as
part of the whole prime_self_import test (fail), or as a single subtest (pass).
Using execlists on Gen8+ reverses the pass/fail due to lazy context allocation
which is presumably why this has now been noticed.

This commit applies the same fix to the export-vs-gem_close-race subtest.

Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87627
Signed-off-by: Thomas Daniel <thomas.daniel@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2015-01-29 16:40:06 +02:00
Chris Wilson
7848d21472 igt/gem_tiled_wc: Use correct offsets
A last moment "tidification" in

commit 5e9fac54918e424d928bc15b90e4c65d4cfdd356
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Jan 22 07:52:09 2015 +0000

    igt/gem_tiled_wc: Fix! Finish!

wreaked havoc again.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88816
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-27 09:40:27 +00:00
Libin Yang
ebd8b32bc6 tools/intel_audio_dump: add details dump for Cherryview
This patch adds the details dump for audio registers of Cherryview.

Signed-off-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2015-01-26 16:06:46 +08:00
Thomas Wood
fa94e01ee7 docs: fix parsing issue
Use entities for the special characters '<' and '>' to avoid "<var>" being
treated as a tag.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-01-22 10:12:24 +00:00
Daniel Vetter
6011508afe tests/gem_concurrent_blit: Fix indent
Thrown up my brain's parser for a moment ;-)

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-01-22 10:01:28 +01:00
Daniel Vetter
fbcc7ba20f tests/gem_concurrent_blt: Adjust subtest naming
Our tooling doesn't cope with () in the testnames (piglit becomes all
confused apparently) and the naming convention says to use "blt" and
"render".

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88220
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88349
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-01-22 09:49:17 +01:00
Zhipeng Gong
9f952940c0 test/gem_dummy_reloc_loop: add tests for dual bsd ring
Signed-off-by: Zhipeng Gong <zhipeng.gong@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-22 09:27:52 +01:00
Zhipeng Gong
f8d47cb70d tests/gem_exec_params: check the invalid flags for dual bsd ring
v2: add more tests to address Daniel's comments(Zhipeng)

Signed-off-by: Zhipeng Gong <zhipeng.gong@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-22 09:27:52 +01:00
Zhipeng Gong
17937a0114 i-g-t: check whether kernel has dual bsd ring
v2: change the number to be consistent with upstream (Zhipeng)

Signed-off-by: Zhipeng Gong <zhipeng.gong@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-22 09:27:52 +01:00
Chris Wilson
5e9fac5491 igt/gem_tiled_wc: Fix! Finish!
It helps when testing whether tiled data read back through a linear
mmaping to first tile the data. And not repeatedly unmapping the linear
map stops it from segfaulting.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88686
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-22 08:00:56 +00:00
Rodrigo Vivi
3d65ff780d lib: s/IGT_DEBUG_INTERACTIVE/--interactive-debug=var
Use cmdline variable for interactive debug instead of env var.

v2: Make interactive-debug domain optional and use "all" when not set.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-20 11:36:10 +01:00
Ander Conselvan de Oliveira
eeff390598 kms_plane: Add test that suspends/resumes before getting crc
This adds a test that does a suspend/resume cycle between configuring
a plane and getting the crc value for the pipe. The intention is to
test if the user requested stated is restored properly, instead of
being clobbered by the state read out from the hardware.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-20 11:36:10 +01:00
Chris Wilson
a29f28eba9 igt/drv_module_reload: Check more carefully for a live driver
As drm_open_any() now quietly fails if there is no driver, this
nullifies the effectiviness of using gem_exec_nop as the test for a good
reload. Combine with gem_alive (and guarantee that gem_alive can detect
a dead driver, putting lie to

commit 032f30cb38bb03562ee7fde19cd278b1d8ac31a9
Author: Thomas Wood <thomas.wood@intel.com>
Date:   Tue Jan 13 13:33:57 2015 +0000

    lib: remove unnecessary checks on the drm_open_any return value

) first.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88573
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-19 09:47:03 +00:00
Tim Gore
20d6e0f41b tools/intel_gpu_frequency: remove use of getsubopt
getsubopt is not available in android. The "get" option
doesn't really need sub-options, just display all the
current frequency settings (as per discussion with
Ben Widawsky)

Ben v2: Remove the -geff example in the header
Fixed another typo for the --set while there (found by Dave Gordon)

Signed-off-by: Tim Gore <tim.gore@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2015-01-16 10:23:34 -08:00
Thomas Wood
0167619bbc lib: use critical log level for assertion failure messages
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-01-16 11:11:10 +00:00
Thomas Wood
df11a0f4a8 lib: add a critical warning level
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-01-16 11:11:10 +00:00
Thomas Wood
032f30cb38 lib: remove unnecessary checks on the drm_open_any return value
drm_open_any always returns a valid file descriptor, so there is no need
to check the return value.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-01-15 12:23:04 +00:00
Tim Gore
07e9f3edb9 lib/Android.mk: add -DHAVE_LINUX_KD_H to fix android build
commit cf93bc8df9f5f94a0aedc8b52bad0ad4e036737c by Alan Coopersmith
(introduced to enable solaris builds) reqires HAVE_LINUX_KD_H to be set
in order for kd.h to get picked up in igt_kms.c. This is not currently
set in the Android makefile so Android builds are broken.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-01-15 11:30:39 +00:00
Thomas Wood
6e2fd6f64d tools: add intel_gpu_frequency to .gitignore
intel_gpu_frequency was added in commit 5fb26d1 (intel_gpu_frequency: A
tool to manipulate Intel GPU frequency), but wasn't added to .gitignore.

Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-01-15 11:30:39 +00:00
Thomas Wood
c1d8293cc7 intel_gpu_frequency: fix array bounds warning
Add a parameter for the size of the act_upon array in the parse function
since its size cannot be calculated with ARRAY_SIZE from just the
pointer.

Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-01-15 11:30:39 +00:00
Chris Wilson
a263cc8795 igt/gem_tiled_swapping: Cycle through the bo a couple of times
In order to exercise coherency across swapin/swapout of the same bo,
explicitly loop over all bo a couple of times.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-15 09:41:03 +00:00
Chris Wilson
d3bf83af03 igt/gem_mmap_wc/set-cache-level: Exercise set-cache-level WARNing
With the introduction of mmap(wc) and its unbound GTT write domain, we
can now hit the warning inside set-cache-level, complaining about the
failure to do correct cpu cache tracking.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-15 08:52:00 +00:00
Chris Wilson
3ea7a28072 igt/gem_exec_big: Don't try to repeatedly munmap(NULL)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-14 14:34:16 +00:00
Chris Wilson
3214a27b5b igt/gem_mmap_wc: Reorder gem_close()
Unlike a GTT mmap, a WC mmap does not have a direct reference to the
object, only to the backing storage. If we want to control the domain
correctly for mmap(wc), we have to keep the bo reference around.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88356
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-13 09:18:52 +00:00
Ben Widawsky
5fb26d1469 intel_gpu_frequency: A tool to manipulate Intel GPU frequency
WARNING: very minimally tested

In general you should not need this tool. Its primary purpose is for
benchmarking, and for debugging performance issues.

For many kernel releases now sysfs has supported reading and writing the GPU
frequency. Therefore, this tool provides no new functionality. What it does
provide is an easy to package (for distros) tool that handles the most common
scenarios.

v2:
Get rid of -f from the usage message (Jordan)
Add space before [-s (Jordan)
Add a -c/--custom example (Jordan)
Add a setting for resetting to hardware default (Ken)
Replicate examples in commit message in the source code. (me)

v3:
Its not It's (me)
Add --help/-h to usage
Add Version + man page
Rename tool to intel_gpu_frequency, from intel_frequency
Remove "sudo" from the examples

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>

Here are some sample usages:
$ intel_gpu_frequency --get=cur,min,max,eff
cur: 200 MHz
min: 200 MHz
RP1: 200 MHz
max: 1200 MHz

$ intel_gpu_frequency -g
cur: 200 MHz
min: 200 MHz
RP1: 200 MHz
max: 1200 MHz

$ intel_gpu_frequency -geff
RP1: 200 MHz

$ intel_gpu_frequency --set min=300
$ intel_gpu_frequency --get min
cur: 300 MHz
min: 300 MHz
RP1: 200 MHz
max: 1200 MHz

$ intel_gpu_frequency --custom max=900
$ intel_gpu_frequency --get max
cur: 300 MHz
min: 300 MHz
RP1: 200 MHz
max: 900 MHz

$ intel_gpu_frequency --max
$ intel_gpu_frequency -g
cur: 1200 MHz
min: 1200 MHz
RP1: 200 MHz
max: 1200 MHz

$ intel_gpu_frequency -e
$ intel_gpu_frequency -g
cur: 200 MHz
min: 200 MHz
RP1: 200 MHz
max: 200 MHz

$ intel_gpu_frequency --max
$ intel_gpu_frequency -g
cur: 1200 MHz
min: 1200 MHz
RP1: 200 MHz
max: 1200 MHz

$ intel_gpu_frequency --min
$ intel_gpu_frequency -g
cur: 200 MHz
min: 200 MHz
RP1: 200 MHz
max: 200 MHz
2015-01-12 15:58:21 -08:00
Chris Wilson
cdbc514b41 igt/gem_exec_big: Use mmap(wc) to speed up verification
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-12 12:59:20 +00:00
Chris Wilson
b65903b7db igt/gem_exec_big: Also test a large batch with a large number of relocs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-12 12:59:20 +00:00
Yang, Libin
9917744176 tools/intel_audio_dump: add support for Cherryview
This patch adds support for dumping audio registers of Cherryview.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2015-01-12 14:44:12 +08:00
Ben Widawsky
67eb20c8a3 tools/Makefile: Alphabetize the list
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-01-11 19:32:27 -08:00
Chris Wilson
1dddf32df9 igt/gem_exec_big: Increase stress
We should be able to execute batches up to the full GTT size (give or
take fragmentation), so let's try!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-09 12:24:40 +00:00
Chris Wilson
a315476a6b igt/gem_evict_(alignment|everything): contend with GPU hangs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 17:35:14 +00:00
Chris Wilson
ce79b7aa80 igt/gem_reloc_vs_hang: Inject hangs!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 17:35:14 +00:00
Chris Wilson
5ae9ecaf55 igt/gem_pread_after_blit: Inject hangs!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 17:35:14 +00:00