[Intel-gfx] [PATCH 12/20] drm/i915/slpc: Send SHUTDOWN event

Sagar Arun Kamble sagar.a.kamble at intel.com
Fri Sep 1 07:25:15 UTC 2017


From: Tom O'Rourke <Tom.O'Rourke at intel.com>

Send SLPC shutdown event during disable, suspend, and reset
operations. Sending shutdown event while already shutdown
is OK.

v1: Return void instead of ignored error code (Paulo)
    Removed WARN_ON for checking msb of gtt address of
    shared gem obj. (ChrisW)
    Added SLPC state update during disable, suspend and reset.
    Changed semantics of reset. It is supposed to just disable. (Sagar)

v2-v4: Rebase.

v5: Updated the input data structure. (Sagar)

v6: Rebase.

v7: s/i915_ggtt_offset/guc_ggtt_offset.

Signed-off-by: Tom O'Rourke <Tom.O'Rourke at intel.com>
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble at intel.com>
---
 drivers/gpu/drm/i915/intel_slpc.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_slpc.c b/drivers/gpu/drm/i915/intel_slpc.c
index 49643d3..b8a8437 100644
--- a/drivers/gpu/drm/i915/intel_slpc.c
+++ b/drivers/gpu/drm/i915/intel_slpc.c
@@ -414,6 +414,18 @@ static void host2guc_slpc_query_task_state(struct intel_slpc *slpc)
 	host2guc_slpc(slpc, &data, 4);
 }
 
+static void host2guc_slpc_shutdown(struct intel_slpc *slpc)
+{
+	struct slpc_event_input data = {0};
+	u32 shared_data_gtt_offset = guc_ggtt_offset(slpc->vma);
+
+	data.header.value = SLPC_EVENT(SLPC_EVENT_SHUTDOWN, 2);
+	data.args[0] = shared_data_gtt_offset;
+	data.args[1] = 0;
+
+	host2guc_slpc(slpc, &data, 4);
+}
+
 void intel_slpc_query_task_state(struct intel_slpc *slpc)
 {
 	if (slpc->active)
@@ -563,4 +575,13 @@ void intel_slpc_enable(struct intel_slpc *slpc)
 
 void intel_slpc_disable(struct intel_slpc *slpc)
 {
+	struct slpc_shared_data data;
+
+	host2guc_slpc_shutdown(slpc);
+
+	/* Ensure SLPC is not running prior to releasing Shared data */
+	intel_slpc_read_shared_data(slpc, &data);
+	WARN_ON(data.global_state != SLPC_GLOBAL_STATE_NOT_RUNNING);
+
+	slpc->active = false;
 }
-- 
1.9.1



More information about the Intel-gfx mailing list