529 Commits

Author SHA1 Message Date
Damien Lespiau
eab0823e0e ddi_compute_wrpll: Do not use a double constant
Otherwise the expression will be promoted to a floating point
multiplication

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-05-10 15:26:42 +01:00
Damien Lespiau
3b79360642 ddi_compute_wrpll: Factor out a common expression
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-05-10 15:26:42 +01:00
Damien Lespiau
4897ac41da ddi_compute_wrpll: Rework the logic around r2 and n2 a bit
Let's not use the 2K variants of the frequencies it does not help
in anything here and the explanations are hopefuly more understandable
this way.

On top of that, I noticed that we can just compute the desired min/max
boundaries for r2 and n2, so use that instead of the two tests to
discard out of range values.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-05-10 15:26:42 +01:00
Damien Lespiau
bb1dfd5613 ddi_compute_wrpll: Fix the reference for 222525Khz and 296703Khz
Assume that the budget for those frequencies were tuned after the
reference table was created.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-05-10 15:26:41 +01:00
Damien Lespiau
a59b0cd01d ddi_compute_wrpll: Fix the reference table for 37762500Hz
The 5 was lost when stored in KHz.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-05-10 15:26:41 +01:00
Damien Lespiau
8cf09e5ed4 ddi_compute_wrpll: Code the reference frequencies in Hz
Because the reference frequencies were stored in KHz, we've lost
precision for 37762500Hz and the test is failing. Let's express the
reference frequencies in Hz then.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-05-10 15:26:41 +01:00
Damien Lespiau
0be2723c30 tools: Add a standalone tool to test the computation of r,n,p for WRPLLs
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-05-10 15:26:41 +01:00
Daniel Vetter
3d9beff623 tests: fix script testlist
Oops. This has been broken since:

commit d798ab9c2a092a08e14c6f2dfb1777376ba407a8
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Tue Dec 18 22:55:58 2012 +0100

    tests: add testcase to check igt runtime enviroment
2013-05-09 17:17:56 +02:00
Imre Deak
01b408e43a testdisplay: set VT graphics mode
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-05-08 21:00:52 +02:00
Imre Deak
0009a4af3d kms_flip: set VT graphics mode
This is one reason for some of the sporadic kms_flip failures.
One such is https://bugs.freedesktop.org/show_bug.cgi?id=59834.

v2:
- use unsigned long for KDSETMODE/KDGETMODE
- fix passing the parameter to KDGETMODE as it should be by value
- actually testing that it works..

v3:
- don't do an explicit DPMS_ON, only switch to graphics mode.

v4:
- use the newly added drmtest_set_vt_graphics_mode(), which will also
  take care of restoring the original mode. (Daniel)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-05-08 21:00:45 +02:00
Imre Deak
d2f7a66fee kms_flip: suppress uninitialized var warning
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-05-08 20:56:57 +02:00
Damien Lespiau
ec3e7a66f0 Update .gitignore files with the new tests and tools
Also sort them.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-05-08 13:34:31 +01:00
Damien Lespiau
6a82b68e36 build: Make grep silent when running make test
-q will prevent grep from writing to stdout and print "root" when make
test is running as root.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-05-08 13:34:21 +01:00
Zhong Li
a417ef7cc8 i-g-t: gem_dummy_reloc_loop.c: add vebox test case
Aside from adding VEBOX support, this test allows allows the "mixed"
test case variant to work on platforms that have 2 rings which was
previously not the case. To the best of my memory, this might therefore
impact G45, and Ironlake.

Signed-off-by: Zhong Li <zhong.li@intel.com>
[Ben: added commit message, remove num_rings = 1, s/LOCACL/LOCAL]
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-05-03 17:53:57 -07:00
Zhong Li
8ddf84d129 i-g-t: check kernel enable rings or not
1. add functions check kernel enable a ring or not.
2. add function gem_get_num_rings() to check how many rings kernel has
enable.
3. gem_ring_sync_loop.c will call gem_get_num_rings() directly instead
of original static fucntion get_number_rings().

Signed-off-by: Zhong Li <zhong.li@intel.com>
[Ben: Wrapped commit message + whitespace fixes]
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-05-03 17:39:14 -07:00
Daniel Vetter
53d251ac23 tests/prime_udl: don't put dirt into stderr when skipping
It upset's QA's test runner.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-05-02 08:10:15 +02:00
Zhong Li
bafbbf1cc8 gem_exec_nop.c: add vebox test case
v2 (Ben):
Fixed whitespace,
s/HAS_BLT_RING/gem_has_vebox/
s/I915_EXEC_VEBOX/LOCAL_I915_EXEC_VEBOX

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-04-27 11:57:37 -07:00
Zhong Li
21e7e342c1 gem_cs_tlb.c: add vebox test case
v2 (Ben):
Fixed whitespace,
s/HAS_BLT_RING/gem_has_vebox/
s/I915_EXEC_VEBOX/LOCAL_I915_EXEC_VEBOX

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-04-27 11:57:30 -07:00
Zhong Li
b6fa628db0 gem_ring_sync_loop.c: fix an operator error
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-04-27 11:50:55 -07:00
Chris Wilson
2facc1368d Check for vebox support before testing
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63941
2013-04-26 08:30:52 +01:00
Ben Widawsky
cf73a1f241 gem_storedw_loop_vebox: Modernize test to look like blitter
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-04-24 18:56:10 -07:00
Xiang, Haihao
96baf59f3e tests: storedw on VEBOX
v2 (Ben): Define LOCAL_I915_EXEC_VEBOX
Small copyright fixes

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-04-24 18:56:10 -07:00
Xiang, Haihao
f187990bbf gem_ring_sync_loop: test the new ring
The code is surround by a #ifdef...#endif to avoid to break compiling against
the current libdrm release

v2 (Ben): Use VEBOX get param. Thankfully Daniel let us carve this out
way back when.
Spacing cleanups

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-04-24 18:55:16 -07:00
Xiang, Haihao
0a413cd8a9 gem_ring_sync_loop: check the rings supported by the kernel
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-04-24 18:23:00 -07:00
Imre Deak
70afbead46 tests/prime_self_import: add subtest to export/import a second gem buffer
Also add a subtest for the fd=handle_to_fd(), fd2=dup(fd), close(fd)
case (idea from Kristian Høgsberg).

Signed-off-by: Imre Deak <imre.deak@intel.com>

v2:
- add a new subtest instead of modifying the original test (Daniel)
- add a new subtest for testing dup (Kristian)
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-04-17 22:40:13 +02:00
Ville Syrjälä
2fe3f76c25 tests/gem_fenced_exec_thrash: Test with > max fences
Make sure the kernel returns EDEADLK when the number of fences is
exceeded for gen2-3. For gen4+ the test makes sure the kernel ignores
the EXEC_OBJECT_NEEDS_FENCE flag.

Note that I changed the code not to round the num_fences to an even
number. Not sure why that was there, and if there's a reason for it,
we need to add it back.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-04-11 20:01:54 +02:00
Mika Kuoppala
a7ca33b673 tests/gem_seqno_wrap: verify debugfs write with readback
Make sure that debugfs entry works as expected by reading
back the sequence number that was written.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-04-11 17:26:56 +02:00
Ville Syrjälä
918e763e2d tests/gem_tiling_max_stride: Add a test for max fence stride
gem_tiling_max_stride writes a data pattern to an X-tiled buffer using
the maximum supported stride, reads the data back as linear, and
verifies that the data didn't get scrambled on the way.

The test also checks that some invalid stride values are rejected
properly.

v2: Check invalid strides
v3: Check invalid stride with Y-tiling
    Include a few more invalid stride values
    Fix gen3 X-tile size
v4: A few more invalid strides :)
    Drop the useless memset()

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-04-09 20:21:13 +02:00
Ville Syrjälä
1d1f68316f tests: Use gem_available_fences()
lib/drmtest.c provides gem_available_fences(). Use it where
appropriate.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-04-09 20:21:13 +02:00
Ville Syrjälä
e37eb35e19 tests/gem_fenced_exec_thrash: Increase MAX_FENCES to 32
IVB+ supports 32 fence registers, bump the maximum in the test.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-04-09 20:21:13 +02:00
Daniel Vetter
0a8bfbf747 tests/gem_fence_trash: make threaded tests more through-rough
With this at least the y-tiled test reliably fails on my machines, but
x-tiled still passes on some. More ideas to tune this highly welcome.

v2: Fill cpu caches with data for each newly allocated bo. This seems
to do the trick on my snb here _really_ reliably. So apparently the
backsnoop for llc gtt writes is the crucial ingredient here to make
the test fail.

While at it, also stop leaking mmap space.

v3: Fixup commit message.

Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-04-08 09:47:58 +02:00
Daniel Vetter
1677c21291 tests/kms_flip: don't leak gpu hang state
We need to clear out the error_state. While at it also make sure that
the hang was indeed detected.

Whoever writes the next test to race against gpu hangs should probably
extract these two functions into the drmtest library. Which just one
user that's not really worth it right now.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-04-06 18:30:19 +02:00
Daniel Vetter
c97a45ff09 tests/prime_udl: skip harder
I fail.
2013-04-04 11:36:27 +02:00
Daniel Vetter
d16dd3a0f8 tests/prime_udl: proper return values
... especially skip properly if there's no udl device.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-04-04 11:06:37 +02:00
Chris Wilson
74f6e413d3 gem_fence_thrash: Fix array allocation size for LP64 systems 2013-03-27 11:33:24 +00:00
Daniel Vetter
9535fed171 tests/Makefile.am: gem_fence_trash has grown subtests
Need to move it to the right make target now!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-03-27 12:26:46 +01:00
Mika Kuoppala
ee79b8fccd tests: add write-verify test to gem_fence_thrash
Add write-verify test to gem_fence_thrash. Test will create
multiple threads per fence then verify the write into fenced region.

v2: non-threaded, non-tiled tests added. suggested by Chris Wilson.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-03-27 12:23:58 +01:00
Kees Cook
c3bfd738c7 tests: add gem_reloc_overflow to check wrapping
This adds a test to make sure that the execbuffer validation routine is
checking for invalid addresses, single entry overflow, and multi-entry
wrapping overflow.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-03-22 12:19:58 +01:00
Ville Syrjälä
7da0af8855 kms_flip: Don't access freed data
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-03-22 12:19:57 +01:00
Ville Syrjälä
069e35e0fc kms_flip: Add flip-vs-bad-tiling test
flip-vs-bad-tiling tests that page flipping to a Y-tiled buffer returns
an error correctly, rather than triggering kernel BUG for instance.

Create a third fb for this purpose. After the fb has been created,
change its tiling mode to Y. When performing a flip, target this
Y-tiled fb and make sure we get the expected error value.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-03-22 12:19:57 +01:00
Ville Syrjälä
7ab8e53b5d kms_flip: Add a flip-vs-panning-vs-hang test
The flip-vs-panning-vs-hang is just like the regular flip-vs-panning
test, except it also hangs the GPU. This will test whether panning
works after a pending page flip has been cancelled by a GPU reset,
and also whether page flip events get delivered correctly.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-03-22 12:19:57 +01:00
Ville Syrjälä
1f5957c64e kms_flip: Split the "no events" logic into a separate flag
Do not use the TEST_HANG flag to determine whether page flip events are
used. Add a new TEST_NOEVENT flag that can be used to disable the use
of events instead.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-03-22 12:19:57 +01:00
Damien Lespiau
7ee278f176 build: Guard the inclusions of config.h with HAVE_CONFIG_H
autoconf can be configured to not generate a config.h but to give the
defines with command line arguments instead. In this case, there's no
config.h to include.

To work in both cases autoconf adds a HAVE_CONFIG_H define on the command
line to signal there's a config.h to include.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-03-04 15:45:34 +00:00
Damien Lespiau
6526d8c6fc tests: Forbid to run the blit tests with count of 1
Invoking say,

  sudo ./tests/gem_render_linear_blits 1

does not make a lot of sense as we're creating a single bo. The test
does not yell at you and passes, even if the rendercopy function does
not do anything. This makes it quite harmful when trying to debug
rendercopy without realizing that count is the number of allocated bos
and must be >= 2.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-02-18 19:54:16 +01:00
Damien Lespiau
50c45f9586 tests: Add a quick variant to the gem_storedw_* tests
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-02-13 18:09:11 +01:00
Yi Sun
6157d242a5 tests/testdisplay.c: Remove the variable only_one_mode.
That variable is useless, instead the variables specified_mode_num and specified_disp_id can cover all the situation.
For parameter -o, all three instances should work:

./testdisplay -o 21,4 only test the 4th mode on the connector with id 21.
./testdisplay -o 21   test all the mode lines on the connector wiht id 21.
./testdisplay -o ,4   the -o is ignored, just like -a.

Signed-off-by: Yi Sun <yi.sun@intel.com>
2013-02-13 23:00:07 +08:00
Ben Widawsky
3a752a3d9a configure: slightly more standard --disable-tests
Cc: Julien Cristau <jcristau@debian.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-02-07 10:30:03 -08:00
Mika Kuoppala
b8e5965e8f tests/gem_ctx_exec: properly test destroy_ctx ioctl
Call context destroy with proper ioctl number and
add test to verify that we can't post batchbuffers
with destroyed context.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-02-05 12:02:37 +01:00
Ville Syrjälä
8c4bb7022b kms_flip: Add flip-vs-modeset-vs-hang test
The flip-vs-modeset-vs-hang test will:
1. simulate a GPU hang
2. exec a nop batch
3. schedule a page flip
4. perform a modeset operation

With the current buggy kernel driver, the modeset operation will
hang indefinitely waiting for the flip to complete. Since the
rings are stopped, that will never happen. The current GPU reset
code doesn't play well with page flips either, so a GPU reset
won't fix things.

Once the kernel driver is fixed, the eventual GPU reset will
save the day.

The nop batch buffer is required only because the kernel can't
currently detect GPU hangs, unless there is at least one user
submitted request pending.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-01-30 16:06:29 +01:00
Ville Syrjälä
e1d1beb478 kms_flip: Make flip events optional
Pass an argument to do_page_flip() telling it whether to request flip
events.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-01-30 16:06:26 +01:00