Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] drm/i915: add rc6 residency times to debugfs
@ 2012-03-26  0:33 Ben Widawsky
  2012-03-26  0:33 ` [PATCH 2/3] drm/i915: extract intel_enable_rc6() Ben Widawsky
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Ben Widawsky @ 2012-03-26  0:33 UTC (permalink / raw)
  To: intel-gfx; +Cc: Ben Widawsky

RC6 residency should be in intervals of 1.28us, and the counter wraps.
Here is an example using awk to get the various RC6 and RC6+ residency
times in seconds, since boot.

cat /sys/kernel/debug/dri/0/i915_drpc_info  | grep residency | awk -F':' -F' '  '{print $5 * 1.28 / 1000000}'

This is primarily for debug, and QA/application developers using the
sysfs interface looking for more insight.

Untested on IVB.

v2: move comment to the correct place
commeit message changes

CC: Ouping Zhang <ouping.zhang@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by (v1): Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by (v1): Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_debugfs.c |   11 +++++++++++
 drivers/gpu/drm/i915/i915_reg.h     |    5 +++++
 2 files changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 66c90d4..4257151 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1133,6 +1133,17 @@ static int gen6_drpc_info(struct seq_file *m)
 
 	seq_printf(m, "Core Power Down: %s\n",
 		   yesno(gt_core_status & GEN6_CORE_CPD_STATE_MASK));
+
+	/* Not exactly sure what this is */
+	seq_printf(m, "RC6 \"Locked to RPn\" residency since boot: %d\n",
+		   I915_READ(GEN6_GT_GFX_RC6_LOCKED));
+	seq_printf(m, "RC6 residency since boot: %d\n",
+		   I915_READ(GEN6_GT_GFX_RC6));
+	seq_printf(m, "RC6+ residency since boot: %d\n",
+		   I915_READ(GEN6_GT_GFX_RC6p));
+	seq_printf(m, "RC6++ residency since boot: %d\n",
+		   I915_READ(GEN6_GT_GFX_RC6pp));
+
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index f3609f2..b1c3d35 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3799,6 +3799,11 @@
 						 GEN6_PM_RP_DOWN_THRESHOLD | \
 						 GEN6_PM_RP_DOWN_TIMEOUT)
 
+#define GEN6_GT_GFX_RC6_LOCKED			0x138104
+#define GEN6_GT_GFX_RC6				0x138108
+#define GEN6_GT_GFX_RC6p			0x13810C
+#define GEN6_GT_GFX_RC6pp			0x138110
+
 #define GEN6_PCODE_MAILBOX			0x138124
 #define   GEN6_PCODE_READY			(1<<31)
 #define   GEN6_READ_OC_PARAMS			0xc
-- 
1.7.9.4

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

end of thread, other threads:[~2012-03-27  8:33 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-26  0:33 [PATCH v2 1/3] drm/i915: add rc6 residency times to debugfs Ben Widawsky
2012-03-26  0:33 ` [PATCH 2/3] drm/i915: extract intel_enable_rc6() Ben Widawsky
2012-03-26  9:32   ` Daniel Vetter
2012-03-26  0:33 ` [PATCH v2 3/3] drm/i915: rc6 in sysfs Ben Widawsky
2012-03-26  0:33 ` [PATCH 1/3] build: make sure we have asprintf Ben Widawsky
2012-03-26  0:33 ` [PATCH 2/3] drm/i915: extract card getting Ben Widawsky
2012-03-26  9:33   ` Daniel Vetter
2012-03-26  0:33 ` [PATCH v2 3/3] tests: rc6 residency test Ben Widawsky
2012-03-26  9:37   ` Daniel Vetter
2012-03-26  9:40     ` Daniel Vetter
2012-03-26 21:54       ` Ben Widawsky
2012-03-27  7:22         ` Daniel Vetter
2012-03-27  8:34   ` Daniel Vetter
2012-03-26  9:34 ` [PATCH v2 1/3] drm/i915: add rc6 residency times to debugfs Daniel Vetter
2012-03-26 12:33   ` Eugeni Dodonov
2012-03-26 16:49     ` Ben Widawsky
2012-03-26 22:34     ` Ben Widawsky
2012-03-26 23:04       ` Eugeni Dodonov

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