From: Rodrigo Vivi Subject: [PATCH 7/8] drm/i915: Added debugfs support for PSR Status Date: Fri, 11 Jan 2013 17:57:56 -0200 Message-ID: <1357934277-3300-8-git-send-email-rodrigo.vivi@gmail.com> References: <1357934277-3300-1-git-send-email-rodrigo.vivi@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-yh0-f47.google.com (mail-yh0-f47.google.com [209.85.213.47]) by gabe.freedesktop.org (Postfix) with ESMTP id 74DEE4BFB0 for ; Fri, 11 Jan 2013 12:12:36 -0800 (PST) Received: by mail-yh0-f47.google.com with SMTP id 22so411121yhr.34 for ; Fri, 11 Jan 2013 12:12:35 -0800 (PST) In-Reply-To: <1357934277-3300-1-git-send-email-rodrigo.vivi@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org From: Shobhit Kumar Added support for PSR entry counter and performance counters Signed-off-by: Shobhit Kumar v2: Add psr enabled yes/no info Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/i915_debugfs.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 882a735..39513de 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -1658,6 +1658,39 @@ static int i915_dpio_info(struct seq_file *m, void *data) return 0; } +static int i915_edp_psr_status(struct seq_file *m, void *data) +{ + struct drm_info_node *node = (struct drm_info_node *) m->private; + struct drm_device *dev = node->minor->dev; + struct drm_i915_private *dev_priv = dev->dev_private; + int count; + u32 psrctl, psrstat, psrperf; + + /* Bit 31 gives the PSR enabled */ + psrctl = I915_READ(EDP_PSR_CTL); + seq_printf(m, "PSR Enabled: %s\n", + yesno(psrctl & EDP_PSR_ENABLE)); + + /* Bits 19:16 gives the PSR entry count */ + psrstat = I915_READ(EDP_PSR_STATUS_CTL); + count = ((psrstat >> 16) & 0xf); + + /* Format the PSR Entry Count only for now. + * TBD: Other status information + */ + seq_printf(m, "EDP_PSR_ENTRY_COUNT: %u\n", count); + + /* Current PSR state */ + count = ((psrstat >> 29) & 0x7); + seq_printf(m, "EDP_PSR_CURRENT_STATE: 0x%x\n", count); + + /* Perfromance counter bit 23:0 */ + psrperf = (I915_READ(EDP_PSR_PERF_CNT)) & 0xffffff; + seq_printf(m, "EDP_PSR_PERF_COUNTER: %u\n", psrperf); + + return 0; +} + static ssize_t i915_wedged_read(struct file *filp, char __user *ubuf, @@ -2131,6 +2164,7 @@ static struct drm_info_list i915_debugfs_list[] = { {"i915_swizzle_info", i915_swizzle_info, 0}, {"i915_ppgtt_info", i915_ppgtt_info, 0}, {"i915_dpio", i915_dpio_info, 0}, + {"i915_edp_psr_status", i915_edp_psr_status, 0}, }; #define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list) -- 1.7.11.7