[PATCH 01/58] drm/i915/gt: Exercise lrc_wa_ctx initialisation failure

Chris Wilson chris at chris-wilson.co.uk
Sat Jan 9 11:37:20 UTC 2021


Inject a fault into lrc_init_wa_ctx() to ensure that we can tolerate a
failure to construct the workarounds.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Matt Roper <matthew.d.roper at intel.com>
Reviewed-by: Matt Roper <matthew.d.roper at intel.com>
---
 drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 3 ++-
 drivers/gpu/drm/i915/gt/intel_lrc.c                  | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
index d857d168adcc..a1d70bca02ae 100644
--- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
+++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
@@ -3250,7 +3250,8 @@ int intel_execlists_submission_setup(struct intel_engine_cs *engine)
 		 * because we only expect rare glitches but nothing
 		 * critical to prevent us from using GPU
 		 */
-		drm_err(&i915->drm, "WA batch buffer initialization failed\n");
+		drm_notice(&i915->drm,
+			   "Context switch workaround setup failed\n");
 
 	if (HAS_LOGICAL_RING_ELSQ(i915)) {
 		execlists->submit_reg = uncore->regs +
diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
index 703d9ecc3f7e..f0de3f661042 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -1525,6 +1525,9 @@ int lrc_init_wa_ctx(struct intel_engine_cs *engine)
 
 	__i915_gem_object_flush_map(wa_ctx->vma->obj, 0, batch_ptr - batch);
 	__i915_gem_object_release_map(wa_ctx->vma->obj);
+
+	if (i915_inject_probe_error(engine->i915, -ENODEV))
+		ret = -ENODEV;
 	if (ret)
 		lrc_fini_wa_ctx(engine);
 
-- 
2.20.1



More information about the Intel-gfx-trybot mailing list