summaryrefslogtreecommitdiff
path: root/tests/i915/gem_exec_capture.c
AgeCommit message (Collapse)Author
2022-07-07i915/gem_exec_capture: fix needs_recoverable_ctxNirmoy Das
needs_recoverable_ctx() should check for graphics_ver instead of display_ver. Use intel_graphics_ver() now that we have it. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6356 Signed-off-by: Nirmoy Das <nirmoy.das@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2022-07-06tests/gem_exec_capture: adjust the pi subtestMatthew Auld
This was broken by the kernel change: 71b1669ea9bd ("drm/i915/uapi: tweak error capture on recoverable contexts"). Update the test to use non-recoverable context if needed. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6350 Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Nirmoy Das <nirmoy.das@linux.intel.com> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
2022-06-30tests/i915/capture: handle uapi changesMatthew Auld
We should mark the objects that need to be captured with NEEDS_CPU_ACCESS to ensure we can capture them if they are allocated in lmem. We also need to consider that capture only properly works on non-recoverable context, for discrete platforms. We can now also expect CPU invisible objects to be skipped, for now at least. v2: try to make it backwards compat Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
2022-05-31igt: Promote/rename OS helpersRob Clark
Promote intel_os.c helpers to igt_os.c, so that I can re-use them for some additional msm tests. Just big churny rename, no functional change. Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2022-01-21tests/i915/gem_exec_capture: Fix memory object size in gem_exec_captureJohn Harrison
The capture tests require knowing exactly how big the test allocation is. Part of the test is to compare the captured size against the allocated size to make sure they match. That doesn't work if the allocator creates an object of a different size than was requested without reporting the larger size. Fixes: 85a593809 ("tests/i915/gem_exec_capture: Add support for local memory") Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2022-01-18tests/i915/gem_exec_capture: Restore enginesJohn Harrison
The test was updated some engine properties but not restoring them afterwards. That would leave the system in a non-default state which could potentially affect subsequent tests. Fix it by using the new save/restore engine properties helper functions. v2: Don't restore too soon in the 'pi' test. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2021-12-27tests/i915/gem_exec_capture: Add support for local memoryCh Sai Gowtham
Add support for local memory region (Device memory) Signed-off-by: Ch Sai Gowtham <sai.gowtham.ch@intel.com> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
2021-11-17tests/i915/gem_exec_capture: Minor fix of bug in codeArjun Melkaveri
Minor fix of bug in code, This was causing Test assertion failure in function "__captureN" for gem_execbuf_wr. Signed-off-by: Arjun Melkaveri <arjun.melkaveri@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-11-03tests/i915/gem_exec_capture: Update to support GuC based resetsJohn Harrison
When GuC submission is enabled, GuC itself manages hang detection and recovery. Therefore, any test that relies on being able to trigger an engine reset in the driver will fail. Full GT resets can still be triggered by the driver. However, in that situation detecting the specific context that caused a hang is not possible as the driver has no information about what is actually running on the hardware at any given time. Plus of course, there was no context that caused the hang because the hang was triggered manually, so it's basically a bogus mechanism in the first place! Update the capture test to cause a reset via a the hangcheck mechanism by submitting a hanging batch and waiting. That way it is guaranteed to be testing the correct reset code paths for the current platform, whether that is GuC enabled or not. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2021-11-03tests/i915/gem_exec_capture: Check for memory allocation failureJohn Harrison
The sysfs file read helper does not actually report any errors if a realloc fails. It just silently returns a 'valid' but truncated buffer. This then leads to the decode of the buffer failing in random ways. So, add a check for ENOMEM being generated during the read. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2021-11-03tests/i915/gem_exec_capture: Use contexts and engines properlyJohn Harrison
Some of the capture tests were using explicit contexts, some not. Some were poking the per engine pre-emption timeout, some not. This would lead to sporadic failures due to random timeouts, contexts being banned depending upon how many subtests were run and/or how many engines a given platform has, and other such failures. So, update all tests to be conistent. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2021-11-03tests/i915/gem_exec_capture: Make the error decode a common helperJohn Harrison
The decode of the error capture contents was happening in two different sub-tests with two very different pieces of code. One being much more extensive than the other (actually decodes and verifies the contents of the captured buffers rather than just the address). So, move the code into a common helper function and use that in both places. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2021-11-03tests/i915/gem_exec_capture: Cope with larger page sizesJohn Harrison
At some point, larger than 4KB page sizes were added to the i915 driver. This included adding an informational line to the buffer entries in error capture logs. However, the error capture test was not updated to skip this string, thus it would silently abort processing. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2021-11-03tests/i915/gem_exec_capture: Remove pointless assertJohn Harrison
The 'many' test ended with an 'assert(count)', presumably meaning to ensure that some objects were actually captured. However, 'count' is the number of objects created not how many were captured. Plus, there is already a 'require(count > 1)' at the start and count is invarient so the final assert is basically pointless. General concensus appears to be that the test should not fail irrespective of how many blobs are captured as low memory situations could cause the capture to be abbreviated. So just remove the pointless assert completely. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2021-10-08lib: Typechecking minmaxChris Wilson
Add typechecking to the min/max macros and make their locals truly unique-ish to reduce the risk of shadowing. v2: small bug fix, write also height coordinate on rotation test. (jheikkil) v3: Fix up a couple of other max/max_t instances (Ashutosh) Signed-off-by: Juha-Pekka Heikkilä <juha-pekka.heikkila@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Chris Wilson <chris.p.wilson@intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
2021-10-04tests/i915: use device_coherent mmapPriyanka Dandamudi
Update mmap__wc with mmap__device_coherent, as it works on discrete platforms, while still using an explicit WC mmap on integrated platforms. Below are the updated tests: gem_exec_capture gem_exec_nop perf_pmu prime_busy Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi@intel.com> Cc: Matthew Auld <matthew.auld@intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2021-08-17tests/gem_exec_capture: Remove unnecessary multiprocess stop() callZbigniew Kempczyński
I've incidentally missed this during review and line calling intel_allocator_multiprocess_stop() left before merge. Remove this as source of confusion - for igt_fork() we can use standalone allocator within child for some cases (reopen driver or work within new created context). Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-08-13tests/gem_exec_capture: Support gens without relocationsAndrzej Turko
With relocations disabled on newer generations tests must assign addresses to objects by themselves instead of relying on the driver. Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-07-08tests/i915/gem_exec_capture: Convert to intel_ctx_t (v2)Jason Ekstrand
v2 (Zbigniew Kempczyński): - Don't NULL-init ctx - Destroy ctx at the end Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2021-05-27lib/i915/gem_create: Add gem_create_extAndrzej Turko
Add a wrapper for gem_create_ext ioctl (a version of gem_create that accepts extensions). In preparation for the driver change implementing it, a local definition of its id and necessary structs have been added, which are to be erased as soon as those definitions appear in the i915_drm.h file. The new ioctl wrapper is added to a separate file. For consistency the wrapper of the old ioctl, gem_create is moved from ioctl_wrappers to gem_create. Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com> Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com> Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Chris P Wilson <chris.p.wilson@intel.com> Signed-off-by: Matthew Auld <matthew.auld@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2020-11-28i915/gem_exec_capture: Trim the blocking workloadChris Wilson
While we want the capture to last long enough to delay the concurrent client, we don't want to wait forever for the capture to complete to proceed with the testing. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2559 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-10-15tests/i915: Treat gen as unsigned for forward compatibilityChris Wilson
We want to recognise future devices (gen = -1u) and treat them as an extension of the latest known device, which is typically true. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
2020-10-11i915/gem_exec_capture: Check for preempt-reset for rescheduling captureChris Wilson
The async capture is implemented as a side-effect of preempt-reset, restricting it's availablity to the more recent machines. In theory it can be made to work with gen8, we just need to keep on breaking up the global reset into smaller chunks that are free to be rearranged. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-10-08i915/gem_exec_capture: Set preempt-timeout to speed up hangcheckChris Wilson
We set a goal for hangcheck to remove the hung request, and this in part depends on hangcheck being able to make reasonable progress. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-10-07i915/gem_exec_capture: Check the capture runs in isolationChris Wilson
Capturing the error state for one context should not impede progress of other contexts across the system. That is we reset the engine, remove the context from the execution queue, then capture it. Once the hanging request has been removed, we can execute any other context instead. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-05-11Macros fixes: Removed unused & redundant macrosranjeet kumar
Local macros were declared in several files as a prelude to upstream implementations. Now that we ship include/drm-uapi, we can remove LOCAL as we upstream. Cc: Dixit, Ashutosh <ashutosh.dixit@intel.com> Cc: Tahvanainen Jari <jari.tahvanainen@intel.com> Signed-off-by: ranjeet kumar <ranjeet1.kumar@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-05-07lib/i915: Split igt_require_gem() into i915/Chris Wilson
igt_require_gem() is a pecularity of i915/, move it out of the core. Similar opportunistic move of gem_reopen_driver() and gem_quiescent_gpu(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-03-31i915/gem_exec_capture: Dynamise per-engine testsChris Wilson
Convert the per-engine tests into a dynamic subtest. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2019-12-03tests/i915/gem: remove igt_skip_on_simulation()Swati Sharma
Removing igt_skip_on_simulation() from all the gem tests since this feature is not supported anymore. v2: Rebase v3: Corrected build failure, because of deletion of gem_exec_blt.c Signed-off-by: Swati Sharma <swati2.sharma@intel.com> Signed-off-by: Karthik B S <karthik.b.s@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-10-26lib/i915: Use explicit iterator names in for_each_engine()Chris Wilson
Provide the iterator name as an explicit macro parameter so that it is known to the caller, and allows for them to properly nest loops over all engines. Fixes: ../tests/i915/gem_exec_schedule.c: In function ‘semaphore_noskip’: ../lib/igt_gt.h:84:44: warning: declaration of ‘e__’ shadows a previous local [-Wshadow] for (const struct intel_execution_engine *e__ = intel_execution_engines;\ ^~~ ../tests/i915/gem_exec_schedule.c:653:2: note: in expansion of macro ‘for_each_physical_engine’ for_each_physical_engine(i915, other) { ^~~~~~~~~~~~~~~~~~~~~~~~ ../lib/igt_gt.h:84:44: note: shadowed declaration is here for (const struct intel_execution_engine *e__ = intel_execution_engines;\ ^~~ ../tests/i915/gem_exec_schedule.c:652:2: note: in expansion of macro ‘for_each_physical_engine’ for_each_physical_engine(i915, engine) { ^~~~~~~~~~~~~~~~~~~~~~~~ ../tests/i915/gem_exec_schedule.c: In function ‘measure_semaphore_power’: ../lib/igt_gt.h:84:44: warning: declaration of ‘e__’ shadows a previous local [-Wshadow] for (const struct intel_execution_engine *e__ = intel_execution_engines;\ ^~~ ../tests/i915/gem_exec_schedule.c:1740:3: note: in expansion of macro ‘for_each_physical_engine’ for_each_physical_engine(i915, engine) { ^~~~~~~~~~~~~~~~~~~~~~~~ ../lib/igt_gt.h:84:44: note: shadowed declaration is here for (const struct intel_execution_engine *e__ = intel_execution_engines;\ ^~~ ../tests/i915/gem_exec_schedule.c:1719:2: note: in expansion of macro ‘for_each_physical_engine’ for_each_physical_engine(i915, signaler) { ^~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Andi Shyti <andi.shyti@intel.com>
2019-03-20lib/igt_sysfs: Remove idx from sysfs_openMichał Winiarski
Similar to sysfs_path - more explicit more better. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-01-29i915/gem_exec_capture: Check the strlen() for an empty fileChris Wilson
igt_sysfs_get() only returns NULL if the open() fails, and a valid string otherwise. So if the read() fails with ENODEV (because sysfs doesn't provide the driver with an ->open() callback), we return an empty string, and "No error captured" otherwise. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109481 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2019-01-29tests/gem_exec_capture: Compare instead of assign in an assertPetri Latvala
Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-01-24i915/gem_exec_capture: Really confirm error capturing is enablingChris Wilson
If the device has error capturing disabled, we still allow previous error state to be cleared by a write to sysfs/error. To actually confirm that we can capture a fresh error state, we have to perform a read(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-11-23igt/gem_exec_capture: Capture many, many objectsChris Wilson
Exercise O(N^2) behaviour in reading the error state, and push it to the extreme. Reported-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-10-23tests: Introduce i915 directoryArkadiusz Hiler
We can already move all the tests with distinct prefixes: gem_, gen3_ and i915_. pm_ and drv_ tests will follow in batches, so we can do the adjustments in the reporting/filtering layer of the CI system. v2: Fix test-list.txt generation with meson v3: Fix docs build (Petri) Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Martin Peres <martin.peres@linux.intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Tested-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Chris Wilson <chris@chris-wilson.co.uk>