summaryrefslogtreecommitdiff
path: root/tests/i915
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-02-01 14:22:49 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2019-02-04 09:42:51 +0000
commitcb6610f5a91a08b1d7f8ae910875891003c6f67c (patch)
tree60df3d87eee035cff9a697b268ff865bfa0f147d /tests/i915
parent625b430519992baa253e204fb3204282a897b4e0 (diff)
i915/gem_mocs_settings: Allow hangs around reset tests
To inject a GPU hang, we should ask the kernel first if it is legal to do so. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
Diffstat (limited to 'tests/i915')
-rw-r--r--tests/i915/gem_mocs_settings.c54
1 files changed, 34 insertions, 20 deletions
diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
index 967223f1..5b3b6bc1 100644
--- a/tests/i915/gem_mocs_settings.c
+++ b/tests/i915/gem_mocs_settings.c
@@ -453,26 +453,40 @@ igt_main
continue;
for (unsigned mode = NONE; mode < MAX_MOCS_TEST_MODES; mode++) {
- for (unsigned flags = 0; flags < ALL_MOCS_FLAGS + 1; flags++) {
- /* Trying to test non-render engines for dirtying MOCS
- * values from one context having effect on different
- * context is bound to fail - only render engine is
- * doing context save/restore of MOCS registers.
- * Let's also limit testing values on non-default
- * contexts to render-only.
- */
- if (flags && e->exec_id != I915_EXEC_RENDER)
- continue;
-
- igt_subtest_f("mocs-%s%s%s-%s",
- test_modes[mode],
- flags & MOCS_NON_DEFAULT_CTX ? "-ctx": "",
- flags & MOCS_DIRTY_VALUES ? "-dirty" : "",
- e->name) {
- if (flags & (MOCS_NON_DEFAULT_CTX | MOCS_DIRTY_VALUES))
- gem_require_contexts(fd);
-
- run_test(fd, e->exec_id | e->flags, flags, mode);
+ igt_subtest_group {
+ igt_hang_t hang = {};
+
+ igt_fixture {
+ if (mode == RESET)
+ hang = igt_allow_hang(fd, 0, 0);
+ }
+
+ for (unsigned flags = 0; flags < ALL_MOCS_FLAGS + 1; flags++) {
+ /* Trying to test non-render engines for dirtying MOCS
+ * values from one context having effect on different
+ * context is bound to fail - only render engine is
+ * doing context save/restore of MOCS registers.
+ * Let's also limit testing values on non-default
+ * contexts to render-only.
+ */
+ if (flags && e->exec_id != I915_EXEC_RENDER)
+ continue;
+
+ igt_subtest_f("mocs-%s%s%s-%s",
+ test_modes[mode],
+ flags & MOCS_NON_DEFAULT_CTX ? "-ctx": "",
+ flags & MOCS_DIRTY_VALUES ? "-dirty" : "",
+ e->name) {
+ if (flags & (MOCS_NON_DEFAULT_CTX | MOCS_DIRTY_VALUES))
+ gem_require_contexts(fd);
+
+ run_test(fd, e->exec_id | e->flags, flags, mode);
+ }
+ }
+
+ igt_fixture {
+ if (mode == RESET)
+ igt_disallow_hang(fd, hang);
}
}
}