Skip to contentSkip to conversation

drm/i915: add rc6 residency times to debugfs

PATCH Applied Ben Widawsky 3 participants 5 messages Mar 23, 2012 – Mar 25, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: add rc6 residency times to debugfs

RC6 residency should be in intervals of 1.28us, and the counter wraps. Here is an example using awk to get the RC6 and RC6+ residency 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 QA, but has other applications as well.

CC Arjan van de Ven <[email protected]>
CC Ouping Zhang <[email protected]>
---
 drivers/gpu/drm/i915/i915_debugfs.c |    6 ++++++
 drivers/gpu/drm/i915/i915_reg.h     |    3 +++
 2 files changed, 9 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +6 -0
index 66c90d4..cd67d3c 100644
@@ -1133,6 +1133,12 @@ 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));
+
+	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));
 	return 0;
 }
 
drivers/gpu/drm/i915/i915_reg.h +3 -0
index 52a06be..5382d8b 100644
@@ -3791,6 +3791,9 @@
 						 GEN6_PM_RP_DOWN_THRESHOLD | \
 						 GEN6_PM_RP_DOWN_TIMEOUT)
 
+#define GEN6_GT_GFX_RC6				0x138108
+#define GEN6_GT_GFX_RC6p			0x13810C
+
 #define GEN6_PCODE_MAILBOX			0x138124
 #define   GEN6_PCODE_READY			(1<<31)
 #define   GEN6_READ_OC_PARAMS			0xc
Signature · 1 line
1.7.9.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Ben Widawsky

RC6 residency should be in intervals of 1.28us, and the counter wraps. Here is an example using awk to get the RC6 and RC6+ residency 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 QA, but has other applications as well.

Note that we already have this in intel_reg_dumper as well, since
http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/commit/?id=47a5bc505cb972cc94f1fbd9882d4e5c2e72ac43
.

But if it makes sense to include it into kernel as well, why not?

Signature · 2 lines
Eugeni Dodonov
<http://eugeni.dodonov.net/>

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
Quoted 9 lines · On Fri, 23 Mar 2012 13:43:22 -0300 Eugeni Dodonov <[email protected]> wrote:
Quoted 7 lines · Ben Widawsky

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

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

Quoted 9 lines
Quoted 2 lines

This is primarily for QA, but has other applications as well.

Note that we already have this in intel_reg_dumper as well, since
http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/commit/?id=47a5bc505cb972cc94f1fbd9882d4e5c2e72ac43
.

But if it makes sense to include it into kernel as well, why not?

Yeah, reg dumper does a whole lot of other stuff in addition to this. I'd agree it wouldn't be worth adding a new debugfs entry though since reg dumper does it (obviously intel_reg_read does it too :)).

Quoted 2 lines
#3 lore raw
In reply to Eugeni Dodonov
Quoted 12 lines · Eugeni Dodonov
Quoted 9 lines · Ben Widawsky

RC6 residency should be in intervals of 1.28us, and the counter wraps. Here is an example using awk to get the RC6 and RC6+ residency 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 QA, but has other applications as well.

Quoted 7 lines

Note that we already have this in intel_reg_dumper as well, since
http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/commit/?id=47a5bc505cb972cc94f1fbd9882d4e5c2e72ac43
.

But if it makes sense to include it into kernel as well, why not?

Queued for -next, thanks for the patch and review. -Daniel

Signature · 3 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48
#4 lore raw
Quoted 17 lines · Daniel Vetter
Quoted 16 lines · Eugeni Dodonov
Quoted 9 lines · Ben Widawsky

RC6 residency should be in intervals of 1.28us, and the counter wraps. Here is an example using awk to get the RC6 and RC6+ residency 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 QA, but has other applications as well.

Note that we already have this in intel_reg_dumper as well, since
http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/commit/?id=47a5bc505cb972cc94f1fbd9882d4e5c2e72ac43
.

Quoted 5 lines
Quoted 3 lines

But if it makes sense to include it into kernel as well, why not?

Queued for -next, thanks for the patch and review.

Unqueued after some irc discussion with Ben, looks like we don't yet fully understand how this works (and at least an rc6pp reg seems to be missing). -Daniel

Signature · 3 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48