[PATCH v2 06/11] drm/i915/guc: Only release GuC log object during submission_fini

Sagar Arun Kamble sagar.a.kamble at intel.com
Tue Oct 31 17:48:48 UTC 2017


GuC log runtime/relay channel data is released during i915 unregister,
so only GuC log vma needs to be released during submission_fini.

v2: Refined usage of intel_guc_log_destroy and created new function
intel_guc_log_runtime_destroy. (Tvrtko)

Signed-off-by: Sagar Arun Kamble <sagar.a.kamble at intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
---
 drivers/gpu/drm/i915/i915_guc_submission.c | 1 +
 drivers/gpu/drm/i915/intel_guc_log.c       | 7 +++----
 drivers/gpu/drm/i915/intel_guc_log.h       | 1 +
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
index 3049a07..268cfec 100644
--- a/drivers/gpu/drm/i915/i915_guc_submission.c
+++ b/drivers/gpu/drm/i915/i915_guc_submission.c
@@ -1271,6 +1271,7 @@ int i915_guc_submission_init(struct drm_i915_private *dev_priv)
 err_wq:
 	guc_preempt_work_destroy(guc);
 err_log:
+	intel_guc_log_runtime_destroy(&dev_priv->guc);
 	intel_guc_log_destroy(guc);
 err_shared_data:
 	guc_shared_data_destroy(guc);
diff --git a/drivers/gpu/drm/i915/intel_guc_log.c b/drivers/gpu/drm/i915/intel_guc_log.c
index 200f0a1..04a9a90 100644
--- a/drivers/gpu/drm/i915/intel_guc_log.c
+++ b/drivers/gpu/drm/i915/intel_guc_log.c
@@ -442,7 +442,7 @@ static int guc_log_runtime_create(struct intel_guc *guc)
 	return ret;
 }
 
-static void guc_log_runtime_destroy(struct intel_guc *guc)
+void intel_guc_log_runtime_destroy(struct intel_guc *guc)
 {
 	/*
 	 * It's possible that the runtime stuff was never allocated because
@@ -481,7 +481,7 @@ static int guc_log_late_setup(struct intel_guc *guc)
 	return 0;
 
 err_runtime:
-	guc_log_runtime_destroy(guc);
+	intel_guc_log_runtime_destroy(guc);
 err:
 	/* logging will remain off */
 	i915_modparams.guc_log_level = -1;
@@ -586,7 +586,6 @@ int intel_guc_log_create(struct intel_guc *guc)
 
 void intel_guc_log_destroy(struct intel_guc *guc)
 {
-	guc_log_runtime_destroy(guc);
 	i915_vma_unpin_and_release(&guc->log.vma);
 }
 
@@ -662,6 +661,6 @@ void i915_guc_log_unregister(struct drm_i915_private *dev_priv)
 	mutex_lock(&dev_priv->drm.struct_mutex);
 	/* GuC logging is currently the only user of Guc2Host interrupts */
 	intel_disable_guc_interrupts(&dev_priv->guc);
-	guc_log_runtime_destroy(&dev_priv->guc);
+	intel_guc_log_runtime_destroy(&dev_priv->guc);
 	mutex_unlock(&dev_priv->drm.struct_mutex);
 }
diff --git a/drivers/gpu/drm/i915/intel_guc_log.h b/drivers/gpu/drm/i915/intel_guc_log.h
index f512cf7..f4ea084 100644
--- a/drivers/gpu/drm/i915/intel_guc_log.h
+++ b/drivers/gpu/drm/i915/intel_guc_log.h
@@ -52,6 +52,7 @@ struct intel_guc_log {
 
 int intel_guc_log_create(struct intel_guc *guc);
 void intel_guc_log_destroy(struct intel_guc *guc);
+void intel_guc_log_runtime_destroy(struct intel_guc *guc);
 int i915_guc_log_control(struct drm_i915_private *dev_priv, u64 control_val);
 void i915_guc_log_register(struct drm_i915_private *dev_priv);
 void i915_guc_log_unregister(struct drm_i915_private *dev_priv);
-- 
1.9.1



More information about the Intel-gfx-trybot mailing list