Skip to content

Commit a81f781

Browse files
committed
drm/i915/debugfs: Print PSR selective update status register values
The value of this registers will be used to test if PSR2 is doing selective update and if the number of blocks match with the expected. v2: - Using new macros - Changed the string output v3: - reading PSR2_SU_STATUS registers together(Dhinakaran) - printing SU blocks of frames with 0 updates(Dhinakaran) Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190117205548.28378-4-jose.souza@intel.com
1 parent cc8853f commit a81f781

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

drivers/gpu/drm/i915/i915_debugfs.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2608,6 +2608,29 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
26082608
seq_printf(m, "Last exit at: %lld\n", psr->last_exit);
26092609
}
26102610

2611+
if (psr->psr2_enabled) {
2612+
u32 su_frames_val[3];
2613+
int frame;
2614+
2615+
/*
2616+
* Reading all 3 registers before hand to minimize crossing a
2617+
* frame boundary between register reads
2618+
*/
2619+
for (frame = 0; frame < PSR2_SU_STATUS_FRAMES; frame += 3)
2620+
su_frames_val[frame / 3] = I915_READ(PSR2_SU_STATUS(frame));
2621+
2622+
seq_puts(m, "Frame:\tPSR2 SU blocks:\n");
2623+
2624+
for (frame = 0; frame < PSR2_SU_STATUS_FRAMES; frame++) {
2625+
u32 su_blocks;
2626+
2627+
su_blocks = su_frames_val[frame / 3] &
2628+
PSR2_SU_STATUS_MASK(frame);
2629+
su_blocks = su_blocks >> PSR2_SU_STATUS_SHIFT(frame);
2630+
seq_printf(m, "%d\t%d\n", frame, su_blocks);
2631+
}
2632+
}
2633+
26112634
unlock:
26122635
mutex_unlock(&psr->lock);
26132636
intel_runtime_pm_put(dev_priv, wakeref);

0 commit comments

Comments
 (0)