956 Commits

Author SHA1 Message Date
Daniel Vetter
0448eefeb2 tests: add sysfs_rc6_residency to .gitignore 2012-04-11 15:02:32 +02:00
Daniel Vetter
ee014dbb8d tests/sysfs_rc6_residency: add some sleep before testing
That way I can run i-g-t on my ivb without spurious failures.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-04-11 14:55:30 +02:00
Ben Widawsky
f841f4028c tests: rc6 residency test
This is meant to test the sysfs entry for showing rc6 residency in
milliseconds. Remember, sysfs is a permanent interface.

v2: use new get_card interface to try "all" devices
check rc6p and rc6pp in addition to rc6

v3: rename rc6_residency.c to sysfs_rc6_residency.c
print better error messages
skip test if rc6 isn't enabled

v4: update to new sysfs names

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
2012-04-10 21:11:13 -07:00
Ben Widawsky
2585bea428 drm/i915: extract card getting
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-04-10 21:11:13 -07:00
Ben Widawsky
8af53e0b7e build: make sure we have asprintf
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-04-10 21:11:12 -07:00
Chris Wilson
b78243fc61 test/gem_cpu_concurrent_blit: Limit memory usage to half aperture
So that we don't cause needless thrashing on older devices and spoil the
test.
2012-04-10 19:41:43 +01:00
Chris Wilson
da026d8bfe test: Exercise concurrent GPU read/write with CPU domain access
Designed to exercise this patch to i915.ko:

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index fbf1118..57ae1f2 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3181,9 +3181,11 @@ i915_gem_object_set_to_cpu_domain(struct drm_i915_gem_obj
        if (ret)
                return ret;

-       ret = i915_gem_object_wait_rendering(obj);
-       if (ret)
-               return ret;
+       if (write || obj->pending_gpu_write) {
+               ret = i915_gem_object_wait_rendering(obj);
+               if (ret)
+                       return ret;
+       }

        i915_gem_object_flush_gtt_write_domain(obj);

By exercising the conditions whereby should either of the checks be missed
an error is detected.
2012-04-10 19:35:29 +01:00
Daniel Vetter
7601fafbcf tests: explicit use bash
We use bashisms, which debian's default sh dash doesn't like.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-04-10 16:23:18 +02:00
Ben Widawsky
af275bd521 tests: add wedging tests
Used to check that i915_error_state works. Unfortunately this
kills the gpu because wedging is permanent.

Base on a patch by Ben Widawsky.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-04-04 11:13:06 +02:00
Daniel Vetter
bb86947638 tests: fixup drm_lib.sh sourcing
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-04-04 11:13:06 +02:00
Daniel Vetter
e63f1870b4 tests: use / as path separator instead of _
Oops. Originally by me, noticed while reviewing Ben Widawsky's patch.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-04-04 10:56:50 +02:00
Ben Widawsky
888df75a0c tests: use common code for scripts
This removes cut and pasted code and uses a more central source.

Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-04-04 10:49:51 +02:00
Chris Wilson
b7bd1837cc Make the assertions guarding syscalls (drmIoctl in particular) verbose
Currently all we see is gem_read: ret == 0 failed, where it would help
to see the errno and/or the ret.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-29 12:50:07 +01:00
Daniel Vetter
9dbce0991f tests: use gem_create and gem_close more
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-03-24 19:30:29 +01:00
Daniel Vetter
ff93f35151 tests/gem_fence_thrash: make some good use of drmtest helpers
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-03-24 19:22:21 +01:00
Daniel Vetter
11fa358503 tests/gem_exec_faulting_reloc: kill superflous mmap_bo
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-03-24 19:17:43 +01:00
Daniel Vetter
c34e481199 tests: add gem_tiled_after_untiled_blt
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-03-23 19:31:01 +01:00
Daniel Vetter
afbdc7af8d tests: adapt storedw tests to ppgtt
MI_MEM_VIRTUAL actually means use global gtt now, not setting the bit
means use ppgtt. On previous gens, not setting the bits ment 'use
physical memory'. So what, the usual confusion.

Note that for some odd reasong this is broken on gen6, but only on the
bsd ring. Unexpected.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-03-22 14:00:22 +01:00
Daniel Vetter
9e531888ed tests: don't just bail out when there's not enough RAM
... but actually run the test with reduced memory requirements,
as the messages claims. Additional print it to stdout, stderr
seems to imply FAIL in our QA's testing rig.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-03-22 12:27:43 +01:00
Daniel Vetter
16c4f52782 tests: add gem_mmap_offset_exhaustion
This also adds a gem_madvise helper to lib/drmtest.c

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-03-20 14:27:05 +01:00
Daniel Vetter
c4ae3bc412 update .gitingore 2012-03-20 14:26:31 +01:00
Daniel Vetter
f4908880f3 intel_sprite_on: kill overtly verbose and totally content-free comments
/me just hates fluff

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-03-20 14:03:18 +01:00
Daniel Vetter
42b20d4ab9 intel_sprite_on: remove copy&pasted gem functions
Can we just please stop this?

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-03-20 14:00:55 +01:00
Chris Wilson
3928569eed intel_gpu_top: Trust the register access is safe
Fixes intel_gpu_top on gen3 which otherwise refuses to do mmio.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-19 14:25:13 +00:00
Chris Wilson
bf6c480d6d decode: Use the correct start mask for gen3 fence registers
A cut'n'paste error from gen2 apparently.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-19 14:24:22 +00:00
Chris Wilson
d364c28089 configure: Add AC_SYS_LARGEFILE for mmap64 support on 64-bit
Without enabling largefile support the prototype for mmap64() is broken
on Linux/x86_64 with the result being a 32-bit integer sign-extended
to fill a 64-bit pointer. Hilarity ensues.
2012-03-14 10:59:51 +00:00
Eugeni Dodonov
be7ca950d7 intel_reg_read: add a flag to simplify bit decoding
This allows to specify '-d' parameter which will decode individual bits in
each register being read.

The register bits are printed horizontally for space reasons. This
requires more than 80x25 terminal to see them all. An alternative solution
would be to print them vertically, but this will become much more
difficult to read when printing multiple registers at the same time.

v2: fix spacing to get us a bit closer to the code nirvana.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-03-13 17:55:51 -03:00
Eugeni Dodonov
8d45456428 intel_reg_read: support reading multiple registers
The registers must be passed on the command line and will be read
sequentially, one at a time.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-03-13 17:55:51 -03:00
Eugeni Dodonov
b7464e4032 intel_reg_read: add support for getopt
This will allow us to pass more options to it in the future.

v2: fix whitespacing issues and improve scary warning text as suggested by
Paul Menzel.

Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-03-13 17:55:51 -03:00
Daniel Vetter
628ad0c91b tests: some more tuning on the tiled partial pwrite/pread test
... 8 pages is just not enough to somewhat reliably get one page that
needs bit17 swizzling.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-29 20:22:45 +01:00
Daniel Vetter
dac239e2b6 tests/gem_tiled_partial_pread/write: fixes
Astonishing how dense I sometimes am ...
- increase the bo size so that we don't have any round-up to next tile
  size areas (which the 2d blit go over, but the 1d pread/pwrite calls
  will notice).
- correctly set tiling bits when copying back to a linear buffer.
- read back through a tiled bo to avoid messing with swizzling.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-29 18:32:02 +01:00
Daniel Vetter
f1d32d541d tests: add tiled partial pwrite/pread test
And indeed, this blows up.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-29 16:12:24 +01:00
Chris Wilson
a50550f223 lib: Downgrade error for unknown 'swap' not 'ram'
Oops, my mistake for copying a compile fix from another machine...

If we can't detect how much RAM we have, 0 is not a suitable default, so
keep the error for the time being and only downgrade the error for
unknown swap.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 09:31:17 +00:00
Chris Wilson
2035119201 lib: Downgrade error for failing to determine swap interface to a warning
If we can't detect how much swap is available, presume none.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 09:29:11 +00:00
Jesse Barnes
1e74007b4c testdisplay: remove unnecessary passing of width, height, stride, depth
These are globals, no need to shadow them everywhere.
2012-02-27 12:50:50 -08:00
Jesse Barnes
ea4163395e testdisplay: remove plane test support
This is better done in intel_sprite_on and was broken anyway.
2012-02-27 12:46:11 -08:00
Daniel Vetter
488daaa40b demos/intel_sprite_on: build warning fixes
... from Armin Reese.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-22 10:59:20 +01:00
Daniel Vetter
ace4a6e0e9 tests/gem_ringfill: shut up the compiler
Double-include ftl and local variable shadowing. While fixing the
later I've noticed that we mix up width and height in the blt copy
function.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-22 10:50:52 +01:00
Chris Wilson
fa6c2757fe tests/gem_ringfill: Exercise all rings
On SandyBridge, the BLT commands were split from the RENDER commands as
well as the BSD split inherited from Ironlake. So we need to make sure
we do exercise each ring, and in order to do so we also need to make
sure each batch takes longer to execute than it takes for us to
submit it.

v2: Exercise each ring sequentially.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 10:48:03 +01:00
Eric Anholt
5cf5558682 gem_ringfill: Make this actually test that all the batches executed.
I was looking into some strange behavior in Mesa that looks like
batches maybe being skipped, but this test didn't catch it.
2012-02-22 10:45:53 +01:00
Eric Anholt
732547793f intel_reg_dumper: Add dumping of GPU turbo regs.
I was interested in finding why my IVB system is not getting GPU turbo
after suspend/resume.  The piece that looks weird to me is that
INTERRUPT_THRESHOLD is sitting at 0, whereas pre-suspend it's
0x12000000.
2012-02-22 10:45:01 +01:00
Eric Anholt
6624325f13 reg_dumper: Refactor duplicated reg-dumping code. 2012-02-22 10:44:42 +01:00
Eric Anholt
3e0bd266d2 instdone: Fix fallthroughs to invalid instdone bits on newer hardware. 2012-02-22 10:43:19 +01:00
Eric Anholt
4fc909fd48 instdone: Add support for one of the IVB instdone regs.
[danvet: added GAM and GAFM bits.]
2012-02-22 10:43:06 +01:00
Daniel Vetter
8bedcae848 tests/intel_reg_dumper: s/pipe/disp_pipe/ to shut off the compiler
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-16 12:26:23 +01:00
Paulo Zanoni
3b65f179f2 Add intel_panel_fitter tool
The tool allows you to change the panel fitter settings, so you can
change the size of the screen being displayed on your monitor without
changing the real pixel size of your desktop. The biggest use case for
this tool is to work around overscan done by TVs and some monitors in
interlaced mode.

v2: reviews by Ben, Chris and Rodrigo
 - don't install
 - use intel_register_access_init
 - check for maximum X and Y values
 - add a disclaimer saying this is not the real solution
 - print less when pf is disabled and option '-l' is used

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-16 00:01:34 +01:00
Paulo Zanoni
ecad594e02 reg_dumper: change and fix behavior when using dump files
Before this patch, handling dump files was wrong:
- when HAS_PCH_SPLIT was specified, intel_reg_dumper segfaulted inside
  intel_check_pch()
- the "devid" variable was used but not set
- there was no way to specify the device id of the machine used to
  generate the dump file

This patch fixes this behavior with the following changes:
- the HAS_PCH_SPLIT variable is gone
- there is now a '-d' argument that can be used to specify the device id
  used to interpret the results
- when a dump file is used but the '-d' argument is not provided, an
  Ironlake machine is assumed

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-16 00:01:30 +01:00
Paulo Zanoni
ad87b06fd6 reg_dumper: add interlaced information to TRANSCONF
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-16 00:01:28 +01:00
Paulo Zanoni
3310db08d8 reg_dumper: add interlaced and rotation information to PIPECONF
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-16 00:01:25 +01:00
Daniel Vetter
27d1cef2d3 tests: fixup storedw tests
We need to use _INSTRUCTION as the reloc domain because otherwise the
ppgtt pipe_control w/a for snb won't kick in and the test fails.

The storedw tests for blt and bsd are still disabled because the
corresponding patch to flag ppgtt support isn't merged upstream yet.
Without ppgtt these hang my snb here.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-15 17:50:57 +01:00