]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/selftests: Make unbannable contexts for reset handling
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 18 Feb 2019 14:50:50 +0000 (14:50 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 18 Feb 2019 16:00:34 +0000 (16:00 +0000)
igt_ctx_sseu was caught using bannable contexts, and in the course of
resetting rapidly to run its test, was banned. Don't let ourselves ban
the test!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190218145051.18981-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/selftests/i915_gem_context.c
drivers/gpu/drm/i915/selftests/intel_hangcheck.c
drivers/gpu/drm/i915/selftests/intel_workarounds.c

index 7eb58a9d1319f9c70f146e5d53e57a699d3b3272..b7b97c57ad057526bec4a90f5165abc26356cd76 100644 (file)
@@ -967,6 +967,7 @@ __igt_ctx_sseu(struct drm_i915_private *i915,
                ret = PTR_ERR(ctx);
                goto out_unlock;
        }
+       i915_gem_context_clear_bannable(ctx); /* to reset and beyond! */
 
        obj = i915_gem_object_create_internal(i915, PAGE_SIZE);
        if (IS_ERR(obj)) {
index 74e743b101d9c37e7d344409b68593363e2a3944..c32bc31192ae3f1e9d690cbfd7cfb6bd3c236b25 100644 (file)
@@ -56,6 +56,8 @@ static int hang_init(struct hang *h, struct drm_i915_private *i915)
        if (IS_ERR(h->ctx))
                return PTR_ERR(h->ctx);
 
+       GEM_BUG_ON(i915_gem_context_is_bannable(h->ctx));
+
        h->hws = i915_gem_object_create_internal(i915, PAGE_SIZE);
        if (IS_ERR(h->hws)) {
                err = PTR_ERR(h->hws);
index d6bb2005024de41460a4d299cd081da0ce08f3bb..fb479a2c04fb5adbe106e65e77de7cd5be68b732 100644 (file)
@@ -236,6 +236,8 @@ switch_to_scratch_context(struct intel_engine_cs *engine,
        if (IS_ERR(ctx))
                return PTR_ERR(ctx);
 
+       GEM_BUG_ON(i915_gem_context_is_bannable(ctx));
+
        rq = ERR_PTR(-ENODEV);
        with_intel_runtime_pm(engine->i915, wakeref)
                rq = igt_spinner_create_request(spin, ctx, engine, MI_NOOP);