[Intel-gfx] [PATCH] drm/i915: Consolidate forcewake status display

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Tue Mar 10 14:29:58 UTC 2020


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Use new common helper intel_gt_show_forcewake from both old and new
debugfs code.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Cc: Andi Shyti <andi.shyti at intel.com>
---
 drivers/gpu/drm/i915/gt/debugfs_gt_pm.c |  7 +++++--
 drivers/gpu/drm/i915/gt/intel_gt.h      |  2 ++
 drivers/gpu/drm/i915/i915_debugfs.c     | 13 ++-----------
 3 files changed, 9 insertions(+), 13 deletions(-)

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, &gt->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;
 }
 
-- 
2.20.1



More information about the Intel-gfx mailing list