diff options
author | Jason Ekstrand <jason@jlekstrand.net> | 2021-07-08 17:10:18 -0500 |
---|---|---|
committer | Jason Ekstrand <jason@jlekstrand.net> | 2021-07-16 14:51:31 -0500 |
commit | 038d0ef9c33a40aaa411e090407401e63dd752ea (patch) | |
tree | 8405901a1e964d7240c7adaed8cb5789f0f6f006 /tests/i915/gem_ctx_persistence.c | |
parent | dba068b3f63ab3044ec8043977ddc76fb1bf2a4f (diff) |
i915: Improve the precision of command parser checks
The previous gem_has_cmdparser helper took an engine and did nothing
with it. We delete the engine parameter and use the general helper for
the ALL_ENGINES cases. For cases where we really do care about
something more precise, we add a version which takes an intel_ctx_cfg_t
and an engine specifier and is able to say whether or not that
particular engine has the command parser enabled.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: Lakshminarayana Vudum <lakshminarayana.vudum@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/i915/gem_ctx_persistence.c')
-rw-r--r-- | tests/i915/gem_ctx_persistence.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/i915/gem_ctx_persistence.c b/tests/i915/gem_ctx_persistence.c index f514e2b7..c6db06b8 100644 --- a/tests/i915/gem_ctx_persistence.c +++ b/tests/i915/gem_ctx_persistence.c @@ -373,6 +373,7 @@ static void test_nohangcheck_hostile(int i915, const intel_ctx_cfg_t *cfg) static void test_nohangcheck_hang(int i915, const intel_ctx_cfg_t *cfg) { const struct intel_execution_engine2 *e; + int testable_engines = 0; int dir; cleanup(i915); @@ -382,7 +383,11 @@ static void test_nohangcheck_hang(int i915, const intel_ctx_cfg_t *cfg) * we forcibly terminate that context. */ - igt_require(!gem_has_cmdparser(i915, ALL_ENGINES)); + for_each_ctx_cfg_engine(i915, cfg, e) { + if (!gem_engine_has_cmdparser(i915, cfg, e->flags)) + testable_engines++; + } + igt_require(testable_engines); dir = igt_params_open(i915); igt_require(dir != -1); @@ -391,9 +396,13 @@ static void test_nohangcheck_hang(int i915, const intel_ctx_cfg_t *cfg) for_each_ctx_cfg_engine(i915, cfg, e) { int64_t timeout = reset_timeout_ms * NSEC_PER_MSEC; - const intel_ctx_t *ctx = intel_ctx_create(i915, cfg); + const intel_ctx_t *ctx; igt_spin_t *spin; + if (!gem_engine_has_cmdparser(i915, cfg, e->flags)) + continue; + + ctx = intel_ctx_create(i915, cfg); spin = igt_spin_new(i915, .ctx = ctx, .engine = e->flags, .flags = IGT_SPIN_INVALID_CS); |