27 Commits

Author SHA1 Message Date
Chris Wilson
b76f1d8b03 igt/gem_mmap_gtt: Check coherency between GTT and CPU mmappings with LLC
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-08 10:29:16 +01:00
Chris Wilson
fedb9b6342 gem_mmap_gtt: Test mmaping less than the full object
A bug was recently introduced into the kernel that happened when the vma
was smaller than the object. Test that.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-21 15:40:25 +01:00
Chris Wilson
d242f2e2a3 igt/gem_mmap_gtt: Exercise concurrent pagefaulting
This should hit the BUG inside remap_pfn_range in

commit c5158fabeaf53ed2c614c3333aaa4b3cce80f500
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jun 10 12:14:41 2014 +0100

[   27.767634] kernel BUG at mm/memory.c:2315!
[   27.767655] invalid opcode: 0000 [#1] SMP
[   27.767679] Modules linked in: cpufreq_userspace cpufreq_powersave cpufreq_stats cpufreq_conservative binfmt_misc nfs lockd fscache sunrpc hid_generic usbhid hid x86_pkg_temp_thermal microcode i2c_i801 lpc_ich mfd_core battery acpi_cpufreq evdev processor ac loop ehci_pci xhci_hcd ehci_hcd sr_mod usbcore cdrom usb_common fan thermal
[   27.767872] CPU: 3 PID: 912 Comm: gem_mmap_gtt Not tainted 3.15.0-rc8+ #953
[   27.767903] Hardware name: Intel Corporation Shark Bay Client platform/Flathead Creek Crb, BIOS HSWLPTU1.86C.0109.R03.1301282055 01/28/2013
[   27.767956] task: ffff880448415010 ti: ffff88044d22c000 task.ti: ffff88044d22c000
[   27.767988] RIP: 0010:[<ffffffff81130734>]  [<ffffffff81130734>] remap_pfn_range+0x2a4/0x400
[   27.768033] RSP: 0000:ffff88044d22fc28  EFLAGS: 00010282
[   27.768057] RAX: 0000000000020002 RBX: 00000000000a3b57 RCX: ffff880448b73fe8
[   27.768088] RDX: 0000000000000002 RSI: ffff880000000000 RDI: ffffea000efe8158
[   27.768119] RBP: ffff88044d22fcd8 R08: 00007fc7b57fe000 R09: 00007fc7b57fe000
[   27.768150] R10: 00000000000001fd R11: 0000000000000a9a R12: ffffea000efe8128
[   27.768180] R13: 0000000000000001 R14: 00007fc7b57fd000 R15: 800000000000002f
[   27.768212] FS:  00007fc7977fc700(0000) GS:ffff88045e380000(0000) knlGS:0000000000000000
[   27.768246] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   27.768272] CR2: 00007fc7b67fd000 CR3: 000000044866c000 CR4: 00000000001407e0
[   27.768303] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   27.768333] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[   27.768363] Stack:
[   27.768374]  ffff880448bbb6f8 00000000ffffffff 00007fc7b57fdfff 00007fc7b57fdfff
[   27.768414]  00007fc7b57fe000 ffff88044866c7f8 ffff8804496b08f0 00007fc7b57fdfff
[   27.768454]  fffffff8038ee35a 0000000000001000 ffff88044c208180 00007fc7b57fe000
[   27.768494] Call Trace:
[   27.768511]  [<ffffffff81365277>] i915_gem_fault+0x337/0x340
[   27.768538]  [<ffffffff8112d3c4>] __do_fault+0x34/0x70
[   27.768565]  [<ffffffff8109088e>] ? wake_up_process+0x1e/0x40
[   27.768592]  [<ffffffff8113015c>] do_shared_fault.isra.96+0x2c/0x1f0
[   27.768623]  [<ffffffff81502405>] ? rwsem_down_read_failed+0xe5/0x130
[   27.768654]  [<ffffffff810a2519>] ? __rwsem_do_wake+0x129/0x160
[   27.768682]  [<ffffffff81131085>] handle_mm_fault+0x2b5/0xb80
[   27.768712]  [<ffffffff81270a64>] ? call_rwsem_down_read_failed+0x14/0x30
[   27.768745]  [<ffffffff81036c67>] __do_page_fault+0x167/0x4c0
[   27.768774]  [<ffffffff8109a540>] ? pick_next_task_fair+0x700/0x870
[   27.768804]  [<ffffffff814ff23b>] ? __schedule+0x27b/0x860
[   27.768831]  [<ffffffff81036fec>] do_page_fault+0xc/0x10
[   27.768857]  [<ffffffff815034a2>] page_fault+0x22/0x30
[   27.768881] Code: 4d 85 ed 49 0f 44 d7 80 cc 02 49 81 c6 00 10 00 00 48 83 c3 01 48 83 c1 08 48 09 d0 48 89 41 f8 4d 39 f0 74 32 48 83 39 00 74 c4 <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 48 39 37 75 63 48 8b 45 c8
[   27.769081] RIP  [<ffffffff81130734>] remap_pfn_range+0x2a4/0x400
[   27.769113]  RSP <ffff88044d22fc28>

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-12 15:29:53 +01:00
Daniel Vetter
e49ceb8690 lib: unnecessary header removal for drmtest.h, part 1
Brought a few missing headers to light in ioctl_wrappers.h, too.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 21:07:37 +01:00
Daniel Vetter
adb28fd71d lib: move prefault helpers to igt_debugfs.c
This way all debugfs library code is in one place, ready for some api
documentation care.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-12 21:22:31 +01:00
Daniel Vetter
071e9ca1ca lib: add igt_main macro
In the past new testcases with subtest often forgot to add the call to
igt_exit at the end of their main() function. That is now caught with
a bit more obnoxious asserts, but it's still a nuissance.

This little igt_main macro takes care of that (and also of calling the
subtest machinery initialization code correctly).

If no one objects I'll roll this out for all the simple cases (i.e.
those tests that don't have additional argv parsing on top of the
subtest machinery).

v2: Roll it out across the board.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01 21:10:59 +01:00
Daniel Vetter
225a91bc54 lib/drmtest: include sys/mman.h from drmtest.h
We need it for mmapping to get at PROT_READ|WRITE anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03 10:38:29 +02:00
Daniel Vetter
f73724c362 tests/gem_mmap_gtt: fix access checks
Reading manpages advisable ;-)

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-30 08:15:32 +02:00
Daniel Vetter
694bd81ed6 tests/gem_mmap_gtt: clarify access check checks a bit
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-30 08:13:05 +02:00
Daniel Vetter
cf93ba45b0 tests/gem_mmap_gtt: Add testcase for the vma access manager
Currently fails since the patches aren't merged yet.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-26 19:44:31 +02:00
Daniel Vetter
b3880d3a96 tests: roll out igt_fixture
Also sprinkle igt_assert and igt_require over the setup code to clean
up code while at it. To avoid gcc getting upset about unitialized
variables just move them out of main as global data (where they always
get initialized to 0) - gcc can't see through our igt_fixture and
igt_subtest maze properly.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14 18:02:46 +02:00
Daniel Vetter
a1ca8ef5b1 tests: use igt_exit() consistently with subtests
This is mostly important to get the SKIP reporting right, but I've
found a few stragglers that wanted to get converted over to the igt
result reporting completely.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14 16:08:00 +02:00
Daniel Vetter
83440953e5 tests: s/assert/igt_assert
Just a wholesale rollout for now, we can refine later on.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13 15:07:44 +02:00
Daniel Vetter
1caaf0a6b6 s/drmtest_/igt_/
Requested-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 12:20:22 +02:00
Daniel Vetter
814b135541 s/drmtest_subtest_block/drmtest_subtest/
The _block postfix meant to convey that a C statement/block must
follow can be misread as the verb to block. So drop it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 12:15:16 +02:00
Daniel Vetter
9f6365e4ea lib/drmtest: Add drmtest_subtest_block macro
Doesn't do more than an if (drmtest_run_test(name)) right now, but
as soon as we get a bit of infrastructure to handle test failures and
skipping, this will get more interesting.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:10:26 +02:00
Xiong Zhang
fc5c693014 tests: add reloc, pread, pwrite slow path subtest
the reloc, pread, pwrite slow path will be prevented by prefault,
these subtests will disable prefault first, then do reloc, pread,
pwrite, finally enable prefault.

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
2013-07-19 18:12:44 +02:00
Damien Lespiau
d1e862324b tests: Instrument tests run in simulation to run quickly
We tweak the tests marked as runnable in simulation to run more quickly,
more often then not at the expense of stress testing (which is of an
arguable interest for the initial bring up in simulation). Hopefully the
values chosen still test something, which is not always straightforward.

It does run quickly, the number on an IVB machines are:

$ time sudo IGT_SIMULATION=0 ./piglit-run.py tests/igt.tests foo
[...]
real	2m0.141s
user	0m16.365s
sys	1m33.382s

Vs.

$ time sudo IGT_SIMULATION=1 ./piglit-run.py tests/igt.tests foo
[...]
real	0m0.448s
user	0m0.226s
sys	0m0.183s

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-18 15:56:35 +01:00
Daniel Vetter
af228d4edc tests/gem_mmap_gtt: convert to subtest infrastructure 2012-11-28 12:40:23 +01:00
Daniel Vetter
527cad1618 lib/drmtest: extract gem_mmap
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-10 18:41:46 +01:00
Daniel Vetter
7a6042e87e lib/drmtest: extract gem_create
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-10 18:30:39 +01:00
Daniel Vetter
673e6b220a lib/drmtest: extract gem_set_domain and gem_sync
gem_sync just does a gtt sync by using set_domain(GTT, GTT).

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-10 16:05:34 +01:00
Daniel Vetter
bd5cf9a07d lib/drmtest: extract gem_read
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-10 15:37:53 +01:00
Daniel Vetter
319638ba6d lib/drmtest: extract gem_write
Astonishing how many different function signatures are possible for
something that simple.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-10 15:31:11 +01:00
Daniel Vetter
5dd17d3f4b lib/drmtest: extract gem_close
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-10 15:07:19 +01:00
Daniel Vetter
733a1d9f34 tests/gem_mmap_gtt: also test gtt pwrite paths
This needs a properly pre-faulted dst bo.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-09-15 18:47:21 +02:00
Chris Wilson
9de433a471 tests: Add a simple exercise of GTT mmaps
Test copying between 2 mappings and reading/writing from and to.

References: https://bugs.freedesktop.org/show_bug.cgi?id=38115
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-20 13:55:36 +01:00