[PATCH 1/5] drm/i915/uc: Extract common code from GuC stop/disable phases

Fernando Pacheco fernando.pacheco at intel.com
Mon Aug 26 20:58:12 UTC 2019


Extract some of the common steps between stop/disable communication
phases. We should also be able to include guc_disable_interrupts
as we no longer require the single caller of stop_communication
to be atomic ("drm/i915/selftests: Fixup atomic reset checking").

Signed-off-by: Fernando Pacheco <fernando.pacheco at intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_uc.c | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.c b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
index 71ee7ab035cc..78cd9eae5f7f 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_uc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
@@ -224,29 +224,28 @@ static int guc_enable_communication(struct intel_guc *guc)
 	return 0;
 }
 
-static void guc_stop_communication(struct intel_guc *guc)
+static void __guc_stop_communication(struct intel_guc *guc)
 {
-	intel_guc_ct_stop(&guc->ct);
+	guc_clear_mmio_msg(guc);
+
+	guc_disable_interrupts(guc);
 
 	guc->send = intel_guc_send_nop;
 	guc->handler = intel_guc_to_host_event_handler_nop;
-
-	guc_clear_mmio_msg(guc);
 }
 
-static void guc_disable_communication(struct intel_guc *guc)
+static void guc_stop_communication(struct intel_guc *guc)
 {
-	/*
-	 * Events generated during or after CT disable are logged by guc in
-	 * via mmio. Make sure the register is clear before disabling CT since
-	 * all events we cared about have already been processed via CT.
-	 */
-	guc_clear_mmio_msg(guc);
+	intel_guc_ct_stop(&guc->ct);
 
-	guc_disable_interrupts(guc);
+	__guc_stop_communication(guc);
 
-	guc->send = intel_guc_send_nop;
-	guc->handler = intel_guc_to_host_event_handler_nop;
+	DRM_INFO("GuC communication stopped\n");
+}
+
+static void guc_disable_communication(struct intel_guc *guc)
+{
+	__guc_stop_communication(guc);
 
 	intel_guc_ct_disable(&guc->ct);
 
-- 
2.23.0



More information about the Intel-gfx-trybot mailing list