drm/i915/guc: Handle GuC log flush event in dedicated function
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Mon, 19 Mar 2018 12:50:49 +0000 (12:50 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 21 Mar 2018 15:09:14 +0000 (15:09 +0000)
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@intel.com>
Cc: Michal Winiarski <michal.winiarski@intel.com>
Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Oscar Mateo <oscar.mateo@intel.com>
Reviewed-by: MichaƂ Winiarski <michal.winiarski@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180319125049.48932-1-michal.wajdeczko@intel.com
drivers/gpu/drm/i915/intel_guc.c
drivers/gpu/drm/i915/intel_guc_log.c
drivers/gpu/drm/i915/intel_guc_log.h

index 4b7c9c6415ddfab55e689c2b322cbf318955cef5..8f93f5bef8fdbbb63dc235166b308584bd9db57b 100644 (file)
@@ -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)
index a401f7e72c144f56cf44e06b75e198a5a6f1f49a..401e1704d61edb09d34d57adb2834e5546e8591e 100644 (file)
@@ -623,3 +623,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);
+}
index 1b0d2fa4c0b6aadcb2d03903b7f20366e1fd1370..fa80535a6f9d81c6f7689b237ed91c5ed2b6f385 100644 (file)
@@ -87,4 +87,6 @@ int intel_guc_log_relay_open(struct intel_guc_log *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