diff options
author | Michał Winiarski <michal.winiarski@intel.com> | 2018-03-19 10:53:39 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-03-19 12:23:02 +0000 |
commit | d3fbf9437b22bd663e292d5d5e9f8e37c8eed208 (patch) | |
tree | 0ccae4e7b1576af0c6ec33130536fb5f07073c19 /drivers | |
parent | 2b47733045aaf883c275c3bdbe3b503137144f6e (diff) | |
download | linux-d3fbf9437b22bd663e292d5d5e9f8e37c8eed208.tar.bz2 |
drm/i915/guc: Flush directly in log unregister
Having both guc_flush_logs and guc_log_flush functions is confusing.
While we could just rename things, guc_flush_logs implementation is
quite simple. Let's get rid of it and move its content to unregister.
v2: s/dev_priv/i915 (Sagar)
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180319095348.9716-4-michal.winiarski@intel.com
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/intel_guc_log.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/drivers/gpu/drm/i915/intel_guc_log.c b/drivers/gpu/drm/i915/intel_guc_log.c index 767c0d00fca6..72a71bc94adf 100644 --- a/drivers/gpu/drm/i915/intel_guc_log.c +++ b/drivers/gpu/drm/i915/intel_guc_log.c @@ -461,26 +461,6 @@ static void guc_log_capture_logs(struct intel_guc_log *log) intel_runtime_pm_put(dev_priv); } -static void guc_flush_logs(struct intel_guc_log *log) -{ - struct intel_guc *guc = log_to_guc(log); - struct drm_i915_private *dev_priv = guc_to_i915(guc); - - /* - * Before initiating the forceful flush, wait for any pending/ongoing - * flush to complete otherwise forceful flush may not actually happen. - */ - flush_work(&log->runtime.flush_work); - - /* Ask GuC to update the log buffer state */ - intel_runtime_pm_get(dev_priv); - guc_log_flush(guc); - intel_runtime_pm_put(dev_priv); - - /* GuC would have updated log buffer by now, so capture it */ - guc_log_capture_logs(log); -} - int intel_guc_log_create(struct intel_guc_log *log) { struct intel_guc *guc = log_to_guc(log); @@ -635,7 +615,16 @@ err: void intel_guc_log_unregister(struct intel_guc_log *log) { - guc_flush_log_msg_disable(log_to_guc(log)); + struct intel_guc *guc = log_to_guc(log); + struct drm_i915_private *i915 = guc_to_i915(guc); + + guc_flush_log_msg_disable(guc); + + /* + * Before initiating the forceful flush, wait for any pending/ongoing + * flush to complete otherwise forceful flush may not actually happen. + */ + flush_work(&log->runtime.flush_work); /* * Once logging is disabled, GuC won't generate logs & send an @@ -643,7 +632,12 @@ void intel_guc_log_unregister(struct intel_guc_log *log) * which is yet to be captured. So request GuC to update the log * buffer state and then collect the left over logs. */ - guc_flush_logs(log); + intel_runtime_pm_get(i915); + guc_log_flush(guc); + intel_runtime_pm_put(i915); + + /* GuC would have updated log buffer by now, so capture it */ + guc_log_capture_logs(log); mutex_lock(&log->runtime.lock); |