21 Commits

Author SHA1 Message Date
Chris Wilson
e3b68bb666 lib: Share common __gem_execbuf()
An oft-repeated function to check EXECBUFFER2 for a particular fail
condition.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27 14:45:18 +00:00
Michał Winiarski
52b5d5016e lib/ioctl_wrappers: Add gem_gtt_type exposing raw HAS_ALIASING_PPGTT param
No functional changes.
While I'm here, let's also rename gem_uses_aliasing_ppgtt (since it's
being used to indicate if we are using ANY kind of ppgtt) and introduce
gem_uses_full_ppgtt to drop some unnecessary code from tests that were
previously calling getparam directly instead of using ioctl wrapper.

v2: drop gem_uses_full_48b_ppgtt since it's no longer used anywhere,
    s/48b/64b (Chris)
v3: rebase

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>
2016-01-25 19:44:31 +01:00
Micah Fedke
c81d293aed convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocci
Apply the new API to all call sites within the test suite using the following
semantic patch:

// Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls
@@
identifier i =~ "\bdrm_open_any\b";
@@
- i()
+ drm_open_driver(DRIVER_INTEL)

@@
identifier i =~ "\bdrm_open_any_master\b";
@@
- i()
+ drm_open_driver_master(DRIVER_INTEL)

@@
identifier i =~ "\bdrm_open_any_render\b";
@@
- i()
+ drm_open_driver_render(DRIVER_INTEL)

@@
identifier i =~ "\b__drm_open_any\b";
@@
- i()
+ __drm_open_driver(DRIVER_INTEL)

Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11 14:39:43 +01:00
Thomas Wood
804e11f40d lib: add a single include header
Add a header that includes all the headers for the library. This allows
reorganisation of the library without affecting programs using it and
also simplifies the headers that need to be included to use the library.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21 09:37:10 +01:00
Chris Wilson
b9b82fdc5f igt/gem_exec_parse: Use a macro for pretty printing the test failure
By moving the assert up a level, we get an much improved assertion
failure message (e.g. it includes the batch string that fails).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-29 14:13:05 +01:00
Daniel Vetter
6ee3337b28 tests/gem_exec_parse: Go OCD about C-style comments
Cc: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-11-12 13:43:04 +01:00
Brad Volkin
c1fdc2f0e9 tests/gem_exec_parse: fix batch_len setting for cmd-crossing-page
The size of the batch buffer passed to the kernel is significantly
larger than the size of the batch buffer passed to the function. A
proposed optimization as part of the batch copy kernel series is to
use batch_len for the copy and parse operations, which leads to a
false "batch without MI_BATCH_BUFFER_END" failure for this test.

To fix this, modify the test to set batch_start_offset and batch_len
such that they define the range of actual commands in the batch,
including a few of the surrounding nops for alignment purposes.

v2: update batch_start_offset as well

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-11-12 13:43:04 +01:00
Brad Volkin
a06071c0cf tests/gem_exec_parse: test for chained batch buffers
libva makes extensive use of chained batch buffers. The batch
buffer copy portion of the command parser has the potential to
break chained batches, so add a simple test to make sure that
doesn't happen.

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-21 17:27:36 +02:00
Mika Kuoppala
b77145dd48 lib: Add MI_LOAD_REGISTER_IMM
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-09-05 18:04:14 +03:00
Daniel Vetter
80a4a4fd43 tests/gem_exec_parse: use gem_uses_aliasing_ppgtt
Suggested by Brad Volking.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-07 17:54:30 +02:00
Jesse Barnes
67e29a30d5 gem_exec_parse: require PPGTT as well
The command parser may be present, but not active, so check for PPGTT
before allowing this test to run.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2014-06-26 08:47:08 -07:00
Chris Wilson
6c4b93fdbc igt/gem_exec_parse: Convert to igt_assert_eq
For better test output on failure.

References: https://bugs.freedesktop.org/show_bug.cgi?id=80083
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 09:11:28 +01:00
Brad Volkin
f74c443925 tests/gem_exec_parse: Test for OACONTROL tracking
Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-09 14:25:17 +02:00
Daniel Vetter
d6362ce8a8 tests/gem_cmd_parse: restrict to gen7
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76982
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-03 18:03:21 +02:00
Daniel Vetter
05f6a35d40 tests/gem_exec_parse: fixups for the recent massive refactoring
I think we might have some use for a do_ioctl_expected_errno or some
such thing. But that's for later.

Cc: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-25 14:23:59 +01:00
Brad Volkin
6bf7307d8d tests/gem_exec_parse: Test a command crossing a page boundary
This is a speculative test in that it's not particularly relevant
today, but is important if we switch the parser implementation to
use kmap_atomic instead of vmap.

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-25 14:18:48 +01:00
Brad Volkin
56fee51b31 tests/gem_exec_parse: Test for batches w/o MI_BATCH_BUFFER_END
Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-25 14:18:37 +01:00
Brad Volkin
1f3e03bee3 tests/gem_exec_parse: Add tests for bitmask checks
Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-25 14:17:08 +01:00
Brad Volkin
1b1321cde7 tests/gem_exec_parse: Add tests for register whitelist
Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-25 14:17:03 +01:00
Brad Volkin
59cb7e105e tests/gem_exec_parse: Add tests for rejected commands
Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-25 14:17:01 +01:00
Brad Volkin
e8b4ecd387 tests: Add a test for the command parser
Start with a simple testcase that should pass.

v2: Switch to I915_PARAM_CMD_PARSER_VERSION

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-25 14:16:57 +01:00