summaryrefslogtreecommitdiff
path: root/tests/gem_reset_stats.c
AgeCommit message (Collapse)Author
2018-02-07lib: Move __gem_context_create to common ioctl wrapper library.Antonio Argenziano
This patch adds a context creation ioctl wrapper that returns the error for the caller to consume. Multiple tests that implemented this already, have been changed to use the new library function. v2: - Add gem_require_contexts() to check for contexts support (Chris) v3: - Add gem_has_contexts to check for contexts support and change gem_require_contexts to skip if contests support is not available. (Chris) v4: - Cosmetic changes and use lib function in gem_ctx_create where possible. (Michal) v5: - Use gem_contexts_require() in tests and fixtures. (Chris) Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-01-26tests/gem_reset_stats: Fix retrieval of hangcheck stats expectationAntonio Argenziano
The test expected IOCTL 'I915_GET_RESET_STATS' would return an error when not root. That is no longer true in the driver since commit 4c9c0d09741d ("drm/i915: Fix retrieval of hangcheck stats") and therefore the test was incorrectly failing. v2: - Add the commit that changed the behaviour in the Driver to the commit message. (Michel) v3: - Reuse get_reset_count instead of implementing a new function. (Michel) Cc: Michel Thierry <michel.thierry@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Michel Thierry <michel.thierry@intel.com>
2017-09-08build: remove _GNU_SOURCE from source filesDaniel Vetter
We are, the build system takes care of that. Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-07-17tests/gem_reset_stats: Enforce full chip reset mode before runMichel Thierry
Platforms with per-engine reset enabled (i915.reset=2) are unlikely to perform a full chip reset, keeping the reset_count unmodified. In order to keep the expectations of this test, enforce that full GPU reset is enabled (i915.reset=1). Later on, we can expand the reset_stats ioctl to also return the number of per-engine resets and use reset_count + reset_engine_count when checking for the updated reset count. v2: Rebase, don't use gem_gpu_reset_type directly, since we now have additional helpers. Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Signed-off-by: Michel Thierry <michel.thierry@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-06-20igt/gem_reset_stats: Fix pending batches status expectationAntonio Argenziano
Test expects pending batches to be discarded after a reset. After commit 821ed7df6e2a ("drm/i915: Update reset path to fix incomplete requests"), That is no longer the case. Fixed to expect a normal execution. V2: Updated commit message (Michel Thierry) Cc: Michel Thierry <michel.thierry@intel.com> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Michel Thierry <michel.thierry@intel.com>
2017-01-02igt: Mass conversion to to_user_pointer()Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-13igt/gem_busy: Prevent banning when running multiple hang testsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-09igt/gem_reset_stats: Add time constraints on hang detectionMika Kuoppala
Make sure that injected hang is detected below time threshold. This ensures that we fail if hang was of no-progress type instead of a stuck engine. v2: use igt_seconds_elapsed() (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-13igt/gem_reset_stats: Fix pending batch count for bansChris Wilson
Since 9ba9af2ea4 ("lib: Skip execution in gem_has_ring()"), we no longer do a double execbuf for each hang, as the gem_require_ring() check now does a dummy execution that does not contribuee to the pending batch count. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-04igt/gem_reset_stats: Convert from stop-rings to real hang injectionChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27igt/gem_reset_stats: Convert residual calllers of gem_exec() to gem_execbuf()Chris Wilson
Missed from e3b68bb66683ad4cb4c80df904a3a21c98a2b6c2 due to rebasing fun. gem_reset_stats.c: In function 'inject_hang_ring': gem_reset_stats.c:227:19: error: implicit declaration of function 'gem_exec' [-Werror=implicit-function-declaration] gem_reset_stats.c:227:2: warning: nested extern declaration of 'gem_exec' [-Wnested-externs] 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>
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-06-05tests/gem_reset_stats : mask off ring_stop bitsTim Gore
Function check_gpu_ok checks to make sure that any hangs have cleared by testing for (flags == 0). Some tests set the STOP_RINGS_ALLOW_BAN and STOP_RINGS_ALLOW_ERRORS flags but these do not get cleared by an individual ring reset, (a feature added recently to the driver), leading the check_gpu_ok function to think that the gpu is still hung. So I mask the flags with STOP_RING_ALL, to ignore the mode bits and look only at the bits that stop the rings. Once gpu_check_ok sees that the gpu is not hung I write 0 to stop_rings in order to clear it completely. This is because igt_set_stop_rings will only write to stop_rings if either a) they are currently 0 or b) we are writing 0. If we leave the mode bits set then subsequent calls to igt_set_stop_rings to create hangs will fail. Signed-off-by: Tim Gore <tim.gore@intel.com>
2015-03-06igt.cocci: Replace igt_assert() with igt_assert_CMP() where possibleMatt Roper
The integer comparison macros give us better error output by including the actual values that failed the comparison. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13lib/igt_gt: Document and consolidateDaniel Vetter
Also move forcewake and stop_rings code from igt_debugfs to igt_gt since it fits better. And move the hang injection fork helpers from igt_aux to igt_gt, too. Also push the intel_gen call into igt_hang_ring while at it. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13tests/gem_reset_stat: Use new ctx helpersDaniel Vetter
A bit more invasive since getting rid off all the places meant to flatten some of the control flow with implicit igt_require. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-15lib: remove unnecessary checks on the drm_open_any return valueThomas Wood
drm_open_any always returns a valid file descriptor, so there is no need to check the return value. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-11tests/gem_reset_stats: add defer-hangcheck testMika Kuoppala
to see if one can fool hangcheck by keeping non hanging ring busy v2: break from loop instead of return (Daniel Vetter) Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-05-14tests: sprinkle igt loggingDaniel Vetter
All the cases that simply dump some debug information and couldn't be converted to some of the fancier macros. Some information output removed when it's redundant with the subtest status. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-10tests/gem_reset_stats: fix length check in inject_hangMika Kuoppala
To avoid writing past the batch end. Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-04-10tests/gem_reset_stats: check gpu state before each subtestMika Kuoppala
Some tests, namely the close pending variety, tries to carefully drop all handles to gpu when hang is intruduced, to expose bugs in reset handling without any clients. Add guards after and before tests to really know if the gpu is still alive as the particular test might report success and then gpu dies few seconds after. Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-04-10tests: use lib igt_[get|set]_stop_rings()Mika Kuoppala
on gem_reset_stats, kms_flip and pm_rps. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75876 Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-04-10tests/gem_reset_stats: end hanging batch properlyMika Kuoppala
As we use chained batch into itself to hang the gpu, there was no need to end the batchbuffer with BATCH_BUFFER_END. With the introduction of command parser, the batch need to have proper BATCH_BUFFER_END in it or it will be rejected. While at it, shift the upper half of batch gtt_offset accordingly with gen8+ Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-03-24tests/gem_reset_stats: run non hw context tests also on older gensMika Kuoppala
To gain more coverage on interface, default context and banning. As there is no proper reset support for gen <= 3, we only do limited interface testing on those. Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-23lib: extract igt_aux.[hc]Daniel Vetter
And shovel all the various helpers in there. Also move igt_set_vt_graphics_mode to igt_kms.h since the function is implemented in igt_kms.c. And it fits better. I kinda missed this in the prep work. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib: rename intel_gpu_tools.h to intel_io.hDaniel Vetter
With the header cleanup we can now give this header a suitable name, since it now really only contains register access and other I/O functions and assorted definitions. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib: unnecessary header removal for drmtest.h, part 1Daniel Vetter
Brought a few missing headers to light in ioctl_wrappers.h, too. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib: make rendercopy.h an internal headerDaniel Vetter
And move the public interfaces into intel_batchbuffer.[hc]. A bit messy since we are fairly inconsistent with our header #include handling. Also exclude rendercopy.h from the documentation. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-17lib/igt_debugfs: Remove debugfs from igt_debugfs_openDaniel Vetter
Also update the api docs a bit since the Returns: section was missing. v2: Readd the accidentally lost line for @filename. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-12lib: make igt_debugfs_open infallibleDaniel Vetter
(Almost) no one cared anyway. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-11tests/gem_reset_stats: Correctly wrap global test codeDaniel Vetter
Tests _must_ be able to run as non-root and on non-intel platforms, otherwise the enumeration is busted (since QA enumerates testcases on a gpu-less xeon box). Cc: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-22tests/gem_reset_stats: stop only one ring when submitting hangMika Kuoppala
If we stop all the rings, we can end up blaming the innocent rings on hangcheck. Reference: https://bugs.freedesktop.org/show_bug.cgi?id=73652 Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-19lib: extract igt_drop_rootDaniel Vetter
Useful in other tests. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-14tests/gem_reset_stats: run tests on all ringsMika Kuoppala
Run all relevant tests on all rings. Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-14tests/gem_reset_stats: split ctx testsMika Kuoppala
Split context related tests from non-context ones and cleanup the naming. Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-12tests/gem_reset_stats: add reverse order in close-pending-forkMika Kuoppala
Use own copy of gem_quiescent_gpu() so that test still works if it gets changed. Further improve the test by posting a batch to rings in reverse order. Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-06tests/gem_reset_stats: document the new subtest a bit betterDaniel Vetter
I wanted to add this to Mika's original patch but forgot to git add. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-04tests/gem_reset_stats: add close-pending-forkMika Kuoppala
This triggers use after free oops on request->batch_obj when going through the rings and setting reset status on requests, after a gpu hang. v2: Streamlined the test and added comments (Daniel) Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-20tests/gem_reset_stats: check non root access to reset_statsMika Kuoppala
Getting global reset count needs to be tested with root and non root access. Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-20tests/gem_reset_stats: stop rings after injecting hangMika Kuoppala
To make driver report a simulated hang in dmesg. Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-20tests/gem_reset_stats: add support for BDW+Mika Kuoppala
For BDW+, there BATCH_BUFFER_START is 3 * 32bits in length and length needs to be encoded into the opcode. Suggested-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-20tests/gem_reset_stats: More macros!Daniel Vetter
Instead of freaking out about negating the skip condition and punting I could have remembered that I've solved this already ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-17tests/gem_reset_stats: Use macros a bit moreDaniel Vetter
Just demonstration really. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-13tests: add gem_reset_statsMika Kuoppala
v2: check the ioctl pad and flag parameters Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>