summaryrefslogtreecommitdiff
path: root/tests/gem_exec_parse.c
AgeCommit message (Collapse)Author
2017-03-21Restore "lib: Open debugfs files for the given DRM device"Chris Wilson
This reverts commit 25fbae15262cf570e207e62f50e7c5233e06bc67, restoring commit 301ad44cdf1b868b1ab89096721da91fa8541fdc Author: Tomeu Vizoso <tomeu.vizoso@collabora.com> Date: Thu Mar 2 10:37:11 2017 +0100 lib: Open debugfs files for the given DRM device with fixes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-21Revert "lib: Open debugfs files for the given DRM device"Tomeu Vizoso
This reverts commit 301ad44cdf1b868b1ab89096721da91fa8541fdc. When a render-only device is opened and gem_quiescent_gpu is called, we need to use the debugfs dir for the master device instead. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2017-03-21lib: Open debugfs files for the given DRM deviceTomeu Vizoso
When opening a DRM debugfs file, locate the right path based on the given DRM device FD. This is needed so, in setups with more than one DRM device, any operations on debugfs files affect the expected DRM device. v2: - rebased and fixed new API additions v3: - updated chamelium test, which was missed previously - use the minor of the device for the debugfs path, not the major - have a proper exit handler for calling igt_hpd_storm_reset with the right device fd. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Robert Foss <robert.foss@collabora.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-09igt/gem_exec_parse: add hang detectionChris Wilson
Because byt needs it... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-22igt: Start marking up GEM tests that require an alive GPU to functionChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-01-02igt: Mass conversion to to_user_pointer()Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-16igt/gem_exec_parse: generalise test_lri + debug infoRobert Bragg
This further generalises the description passed to test_lri so we only need one loop over the entries with test_lri deducing the exected errno and value based on whether the register is marked as whitelisted and depending on the current command parser version. Each tested register LRI now gets its own subtest like: igt_subtest_f("test-lri-%s", reg_name) The test_lri helper now also double checks that the initial intel_register_write() takes before issuing the LRI. In case of a failure the test_lri helper now uses igt_debug to log the register name, address and value being tested. Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-17igt/gem_exec_parse: check oacontrol lri bad for >= v9Robert Bragg
OACONTROL is no longer white listed in the command parser so this checks at attempted LRI will be disallowed and (more importantly) checks that userspace doesn't get an EINVAL error for an attempted OACONTROL LRI. This is important becase Mesa application attempt OACONTROL LRIs while initializing and will abort for any execbuf error. Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2016-11-17igt/gem_exec_parse: update registers test for v >= 8Robert Bragg
This combines some parts of the recently added store_lri test with the registers test to be able to first load a distinguishable value before the LRI and explicitly read back the register to determine if the command succeeded or was a NOOP. For now though we won't look at OACONTROL without checking for version 9 of the command parser. This updates the 'bad' test to check the OASTATUS2 register so that we can explicitly read back from the register to check it becomes a NOOP. This adds a struct test_lri for associating a mask with the init/test values so we ignore things like hw status bits that might interfere with the result. Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2016-11-17igt/gem_exec_parse: update hsw_load_register_reg for v >= 8Robert Bragg
This updates the checking of disallowed loads to set a distinguishable value before the load and explicitly check the load was a NOOP by reading back the final value. Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2016-11-17igt/gem_exec_parse: update cmd-crossing-page for >= v8Robert Bragg
Since an access violation won't return an error to userspace for v >= 8 of the command parser this updates the cmd-crossing-page test to explicitly read back from SO_WRITE_OFFSET[0] to see that the command wasn't squashed to a NOOP. Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2016-11-17igt/gem_exec_parse: update bitmasks test for v >=8Robert Bragg
With v8 of the command parser (where we won't get an EINVAL for an access violation) this updates the bitmasks test to explicitly confirm that the command became a NOOP by reading back from where the QW_WRITE would have otherwise landed. Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2016-11-17igt/gem_exec_parse: make basic-rejected version agnosticRobert Bragg
This adapts the basic-rejected test to focus on invalid commands that will result in an EINVAL errno being returned to userspace even with the upcoming version 8 parser change to stop reporting access violations as EINVAL errors. Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2016-11-17igt/gem_exec_parse: req. v < 9 for oacontrol tracking testRobert Bragg
This limits testing the oacontrol tracking (required pairing of oa enable/disable per batch buffer) to version <= 8 of the command parser. Version 9 of the command parser removes all special handling for OACONTROL which is now going to be managed by i915-perf and not programmed from userspace. Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2016-11-17igt/gem_exec_parse: init global parser_version in fixtureRobert Bragg
This adds a static global int parser_version that can be referenced by all subtests without needing multiple GETPARAM requests. Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2016-11-17igt/gem_exec_parse: make global vars local to main()Robert Bragg
Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2016-11-17igt/gem_exec_parse: update hsw_load_register_regRobert Bragg
This generalises hsw_load_register_reg to loop through an array of allowed and disallowed registers and to use the exec_batch[_patched] utilities. Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2016-11-17igt/gem_exec_parse: move hsw_load_register_reg downRobert Bragg
No functional change, just moving hsw_load_regster_reg test code down below the execbuf utilities in preparation for updating to use them. Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2016-11-17igt/gem_exec_parse: some minor cleanupsRobert Bragg
This normalizes the execbuf utilities in this file to all use memset to clear obj, reloc and execbuf structures and set them up in the same order. As I was debugging some unpredictable test failures I was getting unsure that all these structures were being fully initialized. The same I915_GEM_DOMAIN_COMMAND domain is now used with all relocs. The register/command defines have been moved to the top of the file to be available to all tests/utilities. The handle + fd variables are now static. Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2016-11-09igt/gem_exec_parse: Exercise lots of different allocation sizesChris Wilson
Try and exercise the batch-pool vs shrinker. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-21igt/gem_exec_parse: Double check hw validationChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-09igt/gem_exec_parse: Simple exercise for MI_LOAD_REGISTER_REGChris Wilson
Command parser version 7 introduces the ability to copy between regsiters from the Haswell RCS with MI_LOAD_REGISTER_REG. This provides a quick smoketest of that ability. v2: Add some negative tests as well Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27lib: Share common __gem_execbuf()Chris Wilson
An oft-repeated function to check EXECBUFFER2 for a particular fail condition. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-25lib/ioctl_wrappers: Add gem_gtt_type exposing raw HAS_ALIASING_PPGTT paramMichał Winiarski
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>
2015-09-11convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocciMicah Fedke
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-08-21lib: add a single include headerThomas Wood
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-03-29igt/gem_exec_parse: Use a macro for pretty printing the test failureChris Wilson
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>
2014-11-12tests/gem_exec_parse: Go OCD about C-style commentsDaniel Vetter
Cc: Brad Volkin <bradley.d.volkin@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-11-12tests/gem_exec_parse: fix batch_len setting for cmd-crossing-pageBrad Volkin
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-10-21tests/gem_exec_parse: test for chained batch buffersBrad Volkin
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-09-05lib: Add MI_LOAD_REGISTER_IMMMika Kuoppala
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-07-07tests/gem_exec_parse: use gem_uses_aliasing_ppgttDaniel Vetter
Suggested by Brad Volking. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-26gem_exec_parse: require PPGTT as wellJesse Barnes
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-16igt/gem_exec_parse: Convert to igt_assert_eqChris Wilson
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-04-09tests/gem_exec_parse: Test for OACONTROL trackingBrad Volkin
Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-03tests/gem_cmd_parse: restrict to gen7Daniel Vetter
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76982 Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-25tests/gem_exec_parse: fixups for the recent massive refactoringDaniel Vetter
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-25tests/gem_exec_parse: Test a command crossing a page boundaryBrad Volkin
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-25tests/gem_exec_parse: Test for batches w/o MI_BATCH_BUFFER_ENDBrad Volkin
Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-25tests/gem_exec_parse: Add tests for bitmask checksBrad Volkin
Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-25tests/gem_exec_parse: Add tests for register whitelistBrad Volkin
Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-25tests/gem_exec_parse: Add tests for rejected commandsBrad Volkin
Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-25tests: Add a test for the command parserBrad Volkin
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>