diff mbox

[3/5] drm/i915/guc: Deactivate all client doorbells before reset

Message ID 1509889183-2094-3-git-send-email-sagar.a.kamble@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

sagar.a.kamble@intel.com Nov. 5, 2017, 1:39 p.m. UTC
Prior to i915 reset, we need to deactivate all client doorbells
as they will need to be reacquired again post reset. We should
not execute GuC doorbell deallocation flow as GuC might be in
bad state (possibly reason for i915 reset).

Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: MichaƂ Winiarski <michal.winiarski@intel.com>
Cc: Michel Thierry <michel.thierry@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c            |  2 ++
 drivers/gpu/drm/i915/i915_guc_submission.c | 14 ++++++++++++++
 drivers/gpu/drm/i915/i915_guc_submission.h |  1 +
 3 files changed, 17 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index cbce714..879e318 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2963,6 +2963,8 @@  int i915_gem_reset_prepare(struct drm_i915_private *dev_priv)
 
 	i915_gem_revoke_fences(dev_priv);
 
+	i915_guc_clients_reset_prepare(&dev_priv->guc);
+
 	return err;
 }
 
diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
index b989edf..21f7fa7 100644
--- a/drivers/gpu/drm/i915/i915_guc_submission.c
+++ b/drivers/gpu/drm/i915/i915_guc_submission.c
@@ -1113,6 +1113,20 @@  void i915_guc_clients_release_doorbells(struct intel_guc *guc)
 	destroy_doorbell(guc->execbuf_client, true);
 }
 
+void i915_guc_clients_reset_prepare(struct intel_guc *guc)
+{
+	if (!i915_modparams.enable_guc_submission)
+		return;
+
+	/*
+	 * We are only deactivating doorbell unit monitoring. GuC might
+	 * be in bad state and will be reset hence don't execute GuC
+	 * doorbell deallocation flow.
+	 */
+	destroy_doorbell(guc->preempt_client, false);
+	destroy_doorbell(guc->execbuf_client, false);
+}
+
 static void guc_policy_init(struct guc_policy *policy)
 {
 	policy->execution_quantum = POLICY_DEFAULT_EXECUTION_QUANTUM_US;
diff --git a/drivers/gpu/drm/i915/i915_guc_submission.h b/drivers/gpu/drm/i915/i915_guc_submission.h
index 1d5cf22..91ad505 100644
--- a/drivers/gpu/drm/i915/i915_guc_submission.h
+++ b/drivers/gpu/drm/i915/i915_guc_submission.h
@@ -74,6 +74,7 @@  struct i915_guc_client {
 
 void i915_guc_clients_acquire_doorbells(struct intel_guc *guc);
 void i915_guc_clients_release_doorbells(struct intel_guc *guc);
+void i915_guc_clients_reset_prepare(struct intel_guc *guc);
 int i915_guc_submission_init(struct drm_i915_private *dev_priv);
 int i915_guc_submission_enable(struct drm_i915_private *dev_priv);
 void i915_guc_submission_disable(struct drm_i915_private *dev_priv);