[Intel-gfx] [PATCH 4/8] drm/i915: Verify engine workaround state at runtime

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Fri Nov 30 11:31:57 UTC 2018


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Analogue to the previous patch we add at runtime verification that after
engine reset all respective workarounds have been correctly applied.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c          | 3 +++
 drivers/gpu/drm/i915/intel_workarounds.c | 6 ++++++
 drivers/gpu/drm/i915/intel_workarounds.h | 2 ++
 3 files changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 14d019c9455b..a5add317a06b 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -2382,6 +2382,9 @@ int i915_reset_engine(struct intel_engine_cs *engine, const char *msg)
 	if (ret)
 		goto out;
 
+	/* Catch engine workarounds not restored by engine re-init. */
+	intel_engine_workarounds_verify(engine, engine->name);
+
 out:
 	intel_engine_cancel_stop_cs(engine);
 	i915_gem_reset_finish_engine(engine);
diff --git a/drivers/gpu/drm/i915/intel_workarounds.c b/drivers/gpu/drm/i915/intel_workarounds.c
index a5c0d206b2a4..2d17d8a36a57 100644
--- a/drivers/gpu/drm/i915/intel_workarounds.c
+++ b/drivers/gpu/drm/i915/intel_workarounds.c
@@ -1313,6 +1313,12 @@ void intel_engine_workarounds_apply(struct intel_engine_cs *engine)
 	wa_list_apply(engine->i915, &engine->wa_list);
 }
 
+void intel_engine_workarounds_verify(struct intel_engine_cs *engine,
+				     const char *from)
+{
+	wa_list_verify(engine->i915, &engine->wa_list, from);
+}
+
 #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
 #include "selftests/intel_workarounds.c"
 #endif
diff --git a/drivers/gpu/drm/i915/intel_workarounds.h b/drivers/gpu/drm/i915/intel_workarounds.h
index 845c18dc110d..f72cfda32d68 100644
--- a/drivers/gpu/drm/i915/intel_workarounds.h
+++ b/drivers/gpu/drm/i915/intel_workarounds.h
@@ -40,5 +40,7 @@ void intel_whitelist_workarounds_apply(struct intel_engine_cs *engine);
 
 void intel_engine_workarounds_init(struct intel_engine_cs *engine);
 void intel_engine_workarounds_apply(struct intel_engine_cs *engine);
+void intel_engine_workarounds_verify(struct intel_engine_cs *engine,
+				     const char *from);
 
 #endif
-- 
2.19.1



More information about the Intel-gfx mailing list