On 3/17/2018 8:36 PM, Michal Wajdeczko wrote:
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.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx>
Cc: Michal Winiarski <michal.winiarski@xxxxxxxxx>
Cc: Sagar Arun Kamble <sagar.a.kamble@xxxxxxxxx>
Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Oscar Mateo <oscar.mateo@xxxxxxxxx>
Reviewed-by: Sagar Arun Kamble <sagar.a.kamble@xxxxxxxxx>
Ordering of the declarations is an issue but not critical.
---
drivers/gpu/drm/i915/intel_guc.c | 6 +-----
drivers/gpu/drm/i915/intel_guc_log.c | 8 ++++++++
drivers/gpu/drm/i915/intel_guc_log.h | 1 +
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_guc.c b/drivers/gpu/drm/i915/intel_guc.c
index e70bf65..36c8846 100644
--- a/drivers/gpu/drm/i915/intel_guc.c
+++ b/drivers/gpu/drm/i915/intel_guc.c
@@ -389,11 +389,7 @@ void intel_guc_to_host_event_handler(struct intel_guc *guc)
/* Clear the message bits that are handled */
I915_WRITE(SOFT_SCRATCH(15), msg & ~flush);
- /* Handle flush interrupt in bottom half */
- queue_work(guc->log.runtime.flush_wq,
- &guc->log.runtime.flush_work);
-
- guc->log.flush_interrupt_count++;
+ intel_guc_log_handle_flush_event(&guc->log);
} else {
/*
* Not clearing of unhandled event bits won't result in
diff --git a/drivers/gpu/drm/i915/intel_guc_log.c b/drivers/gpu/drm/i915/intel_guc_log.c
index 1c2127b..394f295 100644
--- a/drivers/gpu/drm/i915/intel_guc_log.c
+++ b/drivers/gpu/drm/i915/intel_guc_log.c
@@ -558,6 +558,14 @@ static void guc_flush_logs(struct intel_guc_log *log)
guc_log_capture_logs(log);
}
+void intel_guc_log_handle_flush_event(struct intel_guc_log *log)
+{
+ /* Handle flush event in bottom half */
+ queue_work(log->runtime.flush_wq, &log->runtime.flush_work);
+
+ log->flush_interrupt_count++;
+}
+
int intel_guc_log_create(struct intel_guc_log *log)
{
struct intel_guc *guc = log_to_guc(log);
diff --git a/drivers/gpu/drm/i915/intel_guc_log.h b/drivers/gpu/drm/i915/intel_guc_log.h
index 6264bd5..fc3d58d 100644
--- a/drivers/gpu/drm/i915/intel_guc_log.h
+++ b/drivers/gpu/drm/i915/intel_guc_log.h
@@ -63,6 +63,7 @@ struct intel_guc_log {
void intel_guc_log_init_early(struct intel_guc_log *log);
int intel_guc_log_create(struct intel_guc_log *log);
int intel_guc_log_register(struct intel_guc_log *log);
+void intel_guc_log_handle_flush_event(struct intel_guc_log *log);
void intel_guc_log_unregister(struct intel_guc_log *log);
void intel_guc_log_destroy(struct intel_guc_log *log);
--
Thanks,
Sagar
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx