Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915/uncore: abstract intel_uncore_fw_domains_show()
@ 2026-11-24 18:14 Jani Nikula
  2026-11-24 18:14 ` [PATCH 2/2] drm/i915/uncore: hide uncore forcewake iterators Jani Nikula
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Jani Nikula @ 2026-11-24 18:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

The debugfs shouldn't really have to know about uncore implementation
details. Add a separate function to log the forcewake domains.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c | 14 +-------------
 drivers/gpu/drm/i915/intel_uncore.c           | 18 ++++++++++++++++++
 drivers/gpu/drm/i915/intel_uncore.h           |  2 ++
 3 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c b/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c
index adf2512e2ed5..1b39e5f19192 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c
@@ -70,20 +70,8 @@ static int fw_domains_show(struct seq_file *m, void *data)
 {
 	struct intel_gt *gt = m->private;
 	struct intel_uncore *uncore = gt->uncore;
-	struct intel_uncore_forcewake_domain *fw_domain;
-	unsigned int tmp;
 
-	spin_lock_irq(&uncore->lock);
-
-	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));
-
-	spin_unlock_irq(&uncore->lock);
+	intel_uncore_fw_domains_show(m, uncore);
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 4e10a02f5750..02f6000b203e 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -2691,6 +2691,24 @@ intel_uncore_forcewake_for_reg(struct intel_uncore *uncore,
 	return fw_domains;
 }
 
+void intel_uncore_fw_domains_show(struct seq_file *m, struct intel_uncore *uncore)
+{
+	struct intel_uncore_forcewake_domain *fw_domain;
+	unsigned int tmp;
+
+	spin_lock_irq(&uncore->lock);
+
+	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));
+
+	spin_unlock_irq(&uncore->lock);
+}
+
 #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
 #include "selftests/mock_uncore.c"
 #include "selftests/intel_uncore.c"
diff --git a/drivers/gpu/drm/i915/intel_uncore.h b/drivers/gpu/drm/i915/intel_uncore.h
index 9047d7d4d855..d5de6a172ff3 100644
--- a/drivers/gpu/drm/i915/intel_uncore.h
+++ b/drivers/gpu/drm/i915/intel_uncore.h
@@ -470,6 +470,8 @@ static inline void __iomem *intel_uncore_regs(struct intel_uncore *uncore)
 	return uncore->regs;
 }
 
+void intel_uncore_fw_domains_show(struct seq_file *m, struct intel_uncore *uncore);
+
 struct intel_uncore *to_intel_uncore(struct drm_device *drm);
 
 /*
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-11-26  8:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 18:14 [PATCH 1/2] drm/i915/uncore: abstract intel_uncore_fw_domains_show() Jani Nikula
2026-11-24 18:14 ` [PATCH 2/2] drm/i915/uncore: hide uncore forcewake iterators Jani Nikula
2026-11-24 19:59   ` Ville Syrjälä
2026-11-25  9:12     ` Jani Nikula
2026-11-25 13:59       ` Ville Syrjälä
2026-11-26  8:19         ` Jani Nikula
2026-11-24 19:56 ` [PATCH 1/2] drm/i915/uncore: abstract intel_uncore_fw_domains_show() Ville Syrjälä
2026-11-25  5:29 ` ✓ i915.CI.BAT: success for series starting with [1/2] " Patchwork
2026-11-25  5:30 ` Patchwork
2026-11-25  5:31 ` Patchwork
2026-11-25  5:32 ` Patchwork
2026-11-26  1:22 ` ✓ i915.CI.Full: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox