[Intel-gfx] [PATCH v2] drm/i915/guc: Handle GuC log flush event in dedicated function

Michal Wajdeczko michal.wajdeczko at intel.com
Mon Mar 19 12:50:49 UTC 2018


We already try to keep all GuC log related code in separate file,
handling flush event should be placed there too. This will also
allow future code reuse.

v2: rebased

Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
Cc: Michal Winiarski <michal.winiarski at intel.com>
Cc: Sagar Arun Kamble <sagar.a.kamble at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Oscar Mateo <oscar.mateo at intel.com>
---
 drivers/gpu/drm/i915/intel_guc.c     | 3 +--
 drivers/gpu/drm/i915/intel_guc_log.c | 5 +++++
 drivers/gpu/drm/i915/intel_guc_log.h | 2 ++
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_guc.c b/drivers/gpu/drm/i915/intel_guc.c
index ee5230c..0457403 100644
--- a/drivers/gpu/drm/i915/intel_guc.c
+++ b/drivers/gpu/drm/i915/intel_guc.c
@@ -398,8 +398,7 @@ void intel_guc_to_host_event_handler(struct intel_guc *guc)
 
 	if (msg & (INTEL_GUC_RECV_MSG_FLUSH_LOG_BUFFER |
 		   INTEL_GUC_RECV_MSG_CRASH_DUMP_POSTED))
-		queue_work(guc->log.relay.flush_wq,
-			   &guc->log.relay.flush_work);
+		intel_guc_log_handle_flush_event(&guc->log);
 }
 
 int intel_guc_sample_forcewake(struct intel_guc *guc)
diff --git a/drivers/gpu/drm/i915/intel_guc_log.c b/drivers/gpu/drm/i915/intel_guc_log.c
index 4cb422c..e835bea 100644
--- a/drivers/gpu/drm/i915/intel_guc_log.c
+++ b/drivers/gpu/drm/i915/intel_guc_log.c
@@ -629,3 +629,8 @@ void intel_guc_log_relay_close(struct intel_guc_log *log)
 	guc_log_relay_destroy(log);
 	mutex_unlock(&log->relay.lock);
 }
+
+void intel_guc_log_handle_flush_event(struct intel_guc_log *log)
+{
+	queue_work(log->relay.flush_wq, &log->relay.flush_work);
+}
diff --git a/drivers/gpu/drm/i915/intel_guc_log.h b/drivers/gpu/drm/i915/intel_guc_log.h
index af1532c..51c36ee 100644
--- a/drivers/gpu/drm/i915/intel_guc_log.h
+++ b/drivers/gpu/drm/i915/intel_guc_log.h
@@ -85,4 +85,6 @@ struct intel_guc_log {
 void intel_guc_log_relay_flush(struct intel_guc_log *log);
 void intel_guc_log_relay_close(struct intel_guc_log *log);
 
+void intel_guc_log_handle_flush_event(struct intel_guc_log *log);
+
 #endif
-- 
1.9.1



More information about the Intel-gfx mailing list