Message ID | 20200310142958.12039-1-tvrtko.ursulin@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/i915: Consolidate forcewake status display | expand |
Quoting Tvrtko Ursulin (2020-03-10 14:29:58) > From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > > Use new common helper intel_gt_show_forcewake from both old and new > debugfs code. > > Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > Cc: Andi Shyti <andi.shyti@intel.com> Fair enough, Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Though the question is why didn't we kill off the toplevel fw_domains? -Chris
On 10/03/2020 14:34, Chris Wilson wrote: > Quoting Tvrtko Ursulin (2020-03-10 14:29:58) >> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> >> >> Use new common helper intel_gt_show_forcewake from both old and new >> debugfs code. >> >> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> >> Cc: Andi Shyti <andi.shyti@intel.com> > > Fair enough, > Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> > > Though the question is why didn't we kill off the toplevel fw_domains? Yeah, I was asking myself the same. Looks like there is no users in IGT so we could just as well. Second patch to follow.. Regards, Tvrtko
Hi Tvrtko, On Tue, Mar 10, 2020 at 02:29:58PM +0000, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > > Use new common helper intel_gt_show_forcewake from both old and new > debugfs code. > > Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > Cc: Andi Shyti <andi.shyti@intel.com> Thanks, Reviewed-by: Andi Shyti <andi.shyti@intel.com> Andi
diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.c b/drivers/gpu/drm/i915/gt/debugfs_gt_pm.c index 059c9e5c002e..23328fd4bc91 100644 --- a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.c +++ b/drivers/gpu/drm/i915/gt/debugfs_gt_pm.c @@ -17,9 +17,8 @@ #include "intel_sideband.h" #include "intel_uncore.h" -static int fw_domains_show(struct seq_file *m, void *data) +void intel_gt_show_forcewake(struct intel_gt *gt, struct seq_file *m) { - struct intel_gt *gt = m->private; struct intel_uncore *uncore = gt->uncore; struct intel_uncore_forcewake_domain *fw_domain; unsigned int tmp; @@ -31,7 +30,11 @@ static int fw_domains_show(struct seq_file *m, void *data) seq_printf(m, "%s.wake_count = %u\n", intel_uncore_forcewake_domain_to_str(fw_domain->id), READ_ONCE(fw_domain->wake_count)); +} +static int fw_domains_show(struct seq_file *m, void *data) +{ + intel_gt_show_forcewake(m->private, m); return 0; } DEFINE_GT_DEBUGFS_ATTRIBUTE(fw_domains); diff --git a/drivers/gpu/drm/i915/gt/intel_gt.h b/drivers/gpu/drm/i915/gt/intel_gt.h index 4fac043750aa..119d188807b7 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt.h +++ b/drivers/gpu/drm/i915/gt/intel_gt.h @@ -68,4 +68,6 @@ static inline bool intel_gt_has_init_error(const struct intel_gt *gt) return test_bit(I915_WEDGED_ON_INIT, >->reset.flags); } +void intel_gt_show_forcewake(struct intel_gt *gt, struct seq_file *m); + #endif /* __INTEL_GT_H__ */ diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 8f2525e4ce0f..0ffcb5cfa9e2 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -32,6 +32,7 @@ #include <drm/drm_debugfs.h> #include "gem/i915_gem_context.h" +#include "gt/intel_gt.h" #include "gt/intel_gt_pm.h" #include "gt/intel_gt_requests.h" #include "gt/intel_reset.h" @@ -1057,18 +1058,8 @@ static int ilk_drpc_info(struct seq_file *m) static int i915_forcewake_domains(struct seq_file *m, void *data) { struct drm_i915_private *i915 = node_to_i915(m->private); - struct intel_uncore *uncore = &i915->uncore; - struct intel_uncore_forcewake_domain *fw_domain; - unsigned int tmp; - - seq_printf(m, "user.bypass_count = %u\n", - uncore->user_forcewake_count); - - for_each_fw_domain(fw_domain, uncore, tmp) - seq_printf(m, "%s.wake_count = %u\n", - intel_uncore_forcewake_domain_to_str(fw_domain->id), - READ_ONCE(fw_domain->wake_count)); + intel_gt_show_forcewake(&i915->gt, m); return 0; }