[PATCH 21/21] drm/i915/guc: Check MIA reset while checking GuC load status

Sagar Arun Kamble sagar.a.kamble at intel.com
Thu Oct 12 04:30:14 UTC 2017


Signed-off-by: Sagar Arun Kamble <sagar.a.kamble at intel.com>
---
 drivers/gpu/drm/i915/intel_uc.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index b6f3e151d4..9ce6a8f 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -152,22 +152,37 @@ static void guc_disable_communication(struct intel_guc *guc)
 	guc->send = intel_guc_send_nop;
 }
 
+static inline bool guc_mia_in_reset(struct intel_guc *guc)
+{
+	struct drm_i915_private *dev_priv = guc_to_i915(guc);
+
+	DRM_INFO("GuC status: %8x\n", I915_READ(GUC_STATUS));
+
+	return I915_READ(GUC_STATUS) & GS_MIA_IN_RESET;
+}
+
 static inline bool guc_wopcm_locked(struct intel_guc *guc)
 {
 	struct drm_i915_private *dev_priv = guc_to_i915(guc);
 
+	DRM_INFO("GuC WOPCM status: %8x\n", I915_READ(GUC_WOPCM_SIZE));
+
 	return I915_READ(GUC_WOPCM_SIZE) & GUC_WOPCM_LOCKED;
 }
 
 static inline bool guc_is_loaded(struct intel_guc *guc)
 {
+	DRM_INFO("MinuteIA in Reset: %s GuC WOPCM Locked: %s\n",
+		 yesno(guc_mia_in_reset(guc)),
+		 yesno(guc_wopcm_locked(guc)));
+
 	/*
 	 * If GPU/GuC was not reset post last load and WOPCM is
 	 * still locked, it means GuC is still loaded and is as
 	 * good as RC6 state for GuC. This check can be used while
 	 * resuming from runtime or drm suspend.
 	 */
-	return !guc->reset_after_load && guc_wopcm_locked(guc);
+	return !guc_mia_in_reset(guc) && guc_wopcm_locked(guc);
 }
 
 int intel_uc_init_hw(struct drm_i915_private *dev_priv)
-- 
1.9.1



More information about the Intel-gfx-trybot mailing list