216 Commits

Author SHA1 Message Date
Damien Lespiau
4b34765594 lib: Introduce drmtest_skip_on_simulation()
This will allow us to explicitely blacklist tests we don't want to run
on simulation.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-18 15:48:46 +01:00
Damien Lespiau
c25e892ec3 lib: Rename IGT_QUICK to INTEL_SIMULATION
It's more accurate this way as the quick mode is really useful for in
the simulation environment.

v2: Use the INTEL_ prefix to have a chance to share the same environment
    variable as piglit OpenGL tests

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-18 15:48:42 +01:00
Chris Wilson
c6cec844f9 Make the failure message for drm_open_any() more specific
Do not suggest retrying as root if we already are.
2013-07-03 10:01:15 +01:00
Chris Wilson
9eb7d8950c Avoid corrupting the exitcode with a failure to open a quiescent fd
In the atexit handler, we attempt to quiesce the GPU. This involves
opening a fd - which will fail if the test is not being run as root and
will obliterate the test status and pollute the output.
2013-07-03 10:01:15 +01:00
Daniel Vetter
26af13f84f lib/drmtest: set default sighandler for QUIT in the signal process
Otherwise the thing doesn't reliably die when run from the piglit
framework somehow.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-06-29 18:31:45 +02:00
Imre Deak
67a4ea0ee1 lib: fix drm_fourcc.h include path
Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-06-07 21:29:31 +03:00
Imre Deak
528b1f381c tests: add kms_render
Add a test going through all connectors/crtcs/modes/formats painting to
a front FB with CPU or painting to a back FB with CPU and blitting it
to the front FB.

Only formats understood by cairo are supported for now.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
2013-06-06 01:43:51 +03:00
Imre Deak
f68d964c57 lib: refactor kmstest_create_fb
Factor out parts that will be used by an upcoming patch adding
kmstest_create_fb2.

Also call the fb paint functions directly, there is not much
point in passing a function pointer for that.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
2013-06-06 01:43:51 +03:00
Imre Deak
bfb0cdd668 lib: add kmstest_get_connector_config
This is used by multiple test cases, so make it shared.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
2013-06-06 01:43:51 +03:00
Imre Deak
334baf05ca lib: use kmstest_cairo_printf_line in paint_marker
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
2013-06-06 01:43:51 +03:00
Imre Deak
542a40c485 lib: add kmstest_cairo_printf_line
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
[v3: fix mode printing in paint_output_info() botched by debugging leftover :/ ]
2013-06-06 01:43:51 +03:00
Imre Deak
3a2aed1f30 lib: move connector_type_str and co to drmtest
These are used by multiple test cases, so make them shared.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
2013-06-06 01:43:50 +03:00
Imre Deak
1cb4f90946 tests/lib: make sure the GPU is idle at test start and exit
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64270

v2:
- Make sure also that the GPU is idle at start and error exit of any
  test using drm_open_any(). (Daniel)
v3:
- actually call gem_quiescent_gpu() at exit

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-05-28 18:32:32 +02:00
Imre Deak
a3b47dbe69 lib: make sure all rings are idle in gpu_quiescent_gpu()
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-05-28 18:32:29 +02:00
Imre Deak
bce7d8a061 lib: export the exit handler interface
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-05-22 18:18:28 +02:00
Imre Deak
4dec89aef7 lib: fix exit handler when multiple handlers are registered
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-05-22 18:18:28 +02:00
Imre Deak
cf26435be8 lib: add helper to 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:42 +02: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
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
Daniel Vetter
cb3a44fa26 lib/drmtest: tune down signal handler stats
Avoids tests with a spurious WARN result in piglit.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-04-08 00:31:06 +02:00
Damien Lespiau
c6c6f0f593 lib: Add a comment about why we only parse long options for subtests
For thet next one wondering about that.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-03-22 11:08:17 +00:00
Damien Lespiau
75f52a6e3b lib: Factor out a function to check if an environment variable is set
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-03-04 15:45:18 +00:00
Damien Lespiau
bb33d08845 lib: Add a way to specify values for "quick" runs
In some environments, we don't really want to loop 100000 times or
allocate 152352621 buffers because it makes the tests too long to run.

This adds a way to specify "quick" values to reduce the time taken by
certain 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
Daniel Vetter
0af2b184ad lib: extract kmstest_get_pipe_from_crtc_id 2012-12-17 15:30:54 +01:00
Daniel Vetter
9fc7e1386a lib/drmtest: subtest infrastructure
To make these helpers as least invasive as possible simply initialize
the options with a getopt parser and let the control flow be steered
with a simple helper which gets the subtest name as an argument.

The only tricky part for using it is that the subtest check helper
doubles up as the conduit to enumerate tests (and in that mode
prevents any test from being run). It is therefore important that
nothing gets printed to stdout outside of these checks.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-28 11:57:58 +01:00
Daniel Vetter
021909e10d tests: dont polute stderr if the test succeeds/skips
Results in spurious 'warn' results in piglit. Also don't print
progress indicators when not outputting to a terminal.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-28 11:08:37 +01:00
Imre Deak
21393431f1 drmtest: add function to remove an DRM FB
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-16 16:51:56 +02:00
Imre Deak
6456e75f0d fix warn: 'div' shadows a global declaration
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-10 15:59:02 +02:00
Daniel Vetter
5f94468f52 lib: remove auto-quiescenting of the gpu
In retrospective, this is an ugly idea. Any tests that needs this
can call it themselves.
2012-10-09 19:27:41 +02:00
Daniel Vetter
b8e384a4d5 lib: make drmtest_progress more robust 2012-10-09 17:50:40 +02:00
Daniel Vetter
df7edaab90 lib: helper to convert gem_hanlde to drm_intel_bo 2012-10-02 10:32:10 +02:00
Daniel Vetter
9d1a3587ac drmtest: use do_or_die 2012-10-01 11:34:10 +02:00
Ben Widawsky
54ed938d39 clang: Fix warnings found through clang.
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-08-30 14:19:10 -07:00
Chris Wilson
51baabb562 Add bare-metal interface to adjust cacheing (i.e. snoop status) of a bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-27 09:39:45 +01:00
Yi Sun
41fe811feb tests/testdisplay.c: Add a option '-r'.
With the option '-r', the testdisplay could paint a 2-D bar code(QR
bar code) on the screen. The word "pass" is hiden in the bar code
image.  Further more, with this option, testdisplay will wait until a
system signal 'SIGUSR1' coming after each mode setting. This function
is for another program to control testdisplay.

danvet: Fix up the missing static.

Signed-off-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-07-26 15:01:08 +02:00
Daniel Vetter
6bc22e3dfd tests: add basic re-importing prime test
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-07-23 09:52:10 +02:00
Ben Widawsky
5a28ef8580 context: update for new execbuf2 element
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-06-14 10:15:42 -07:00
Chris Wilson
77586dcdf7 test/gem_gtt_speed: Add a baseline test for the performance of a CPU mmap
When looking at the pwrite/pread/wc performance, it is useful to judge
that against the performance of an ordinary CPU mmap.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-06-04 17:50:51 +01:00
Daniel Vetter
17787f30c6 lib: extract kmstest_dump_mode 2012-05-22 16:15:15 +02:00
Daniel Vetter
662d732199 lib: extract kmstest_create_fb
We should get more kms tests soon, and not needing to copy-paste a
nice test pattern should be useful.

That establishes a firm depency of i-g-t on cairo over everything, but
I don't care so much about that.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-05-22 15:56:29 +02:00
Daniel Vetter
0732cc59ab tests: use drm_open_any more
And fix it up to not leak open fds, which kills all the master only
stuff.
2012-05-22 12:01:36 +02:00
Daniel Vetter
cf72da57dc tests: add gem_unfence_active_buffers
Unfortunately this requires slab poisoning to catch anything :(

Also add a new helper to drmtest to get the available fence count.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-04-22 12:35:23 +02:00
Chris Wilson
5ce86f88a0 Use mmap64() for performing the GTT mapping
Although the address space for GTT mappings may only be 32-bits, we need
to use the explicit 64-bit mmap interface so that on a 32-bit platform
the offset we pass is not truncated to 31-bits.

Fixes gem_mmap_offset_exhaustion on 32-bit platforms.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-12 15:47:00 +01: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
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
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
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
e1ddd1c8e0 lib/drmtest: fixup copy&paste printf format issue
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-11 16:57:05 +01:00
Daniel Vetter
93a65895bb drmtest: add progress indicator
Some test that trash the aperture necessarily need to take forever, so
add a little progress indicator to keep worried minds at peace.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-24 23:18:21 +01:00
Daniel Vetter
98129fa2ff tests: add gem_tiled_swapping
Also add a drmtest_exchange_int helper, might come handy at other
places.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-22 22:28:46 +01:00