From patchwork Wed Jan 30 18:24:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 2069431 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 6D9FF3FD1A for ; Wed, 30 Jan 2013 18:40:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 30027E64EE for ; Wed, 30 Jan 2013 10:40:50 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-gh0-f171.google.com (mail-gh0-f171.google.com [209.85.160.171]) by gabe.freedesktop.org (Postfix) with ESMTP id 13C68E61B1; Wed, 30 Jan 2013 10:30:37 -0800 (PST) Received: by mail-gh0-f171.google.com with SMTP id r17so321925ghr.30 for ; Wed, 30 Jan 2013 10:30:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=H3H4OA5Dn6jdqEJtIMwhPItvx8fpiVbnSEoxQRVPU1Y=; b=hAPiLahMRMUHOj4bwovkW4uzGzH7jyJEvgik0kv7cOE/H6J0vLB/LTHqbz5RQIU7vv UGLVrNPrhUoRceyT/ByEAfBFf+W7Z15vYeYI7r+dAQmIQb0Gtm1v5LGt/juUb9k+59SE LBbh1b3InfoyB9ZCv+o+m5tv4zAtDq5Td9vTGuuZ7qRcckkYTrayKBlbFAsRHNkBI9l9 36fAee0xN1f4DLolbfRUCshf70wbGd4DISZtDA1rQedhR0lFSxMV2b+k2oqshGV8iXzE 2O5GDevW0iKatGVuQ4QuiMZwLeQr28cJs5CBX+FXn3Fj68GSTYKqX26LVG5ZbueVHmwa BnPQ== X-Received: by 10.236.148.50 with SMTP id u38mr6729496yhj.18.1359570637693; Wed, 30 Jan 2013 10:30:37 -0800 (PST) Received: from localhost.localdomain (200.188.217.18.dedicated.neoviatelecom.com.br. [200.188.217.18]) by mx.google.com with ESMTPS id c16sm1873528ann.15.2013.01.30.10.30.35 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 30 Jan 2013 10:30:37 -0800 (PST) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Subject: [PATCH 8/9] drm/i915: Added debugfs support for PSR Status Date: Wed, 30 Jan 2013 16:24:50 -0200 Message-Id: <1359570291-2170-9-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1359570291-2170-1-git-send-email-rodrigo.vivi@gmail.com> References: <1359570291-2170-1-git-send-email-rodrigo.vivi@gmail.com> Cc: Shobhit Kumar , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@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 90a6fc5..11d2896 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -1659,6 +1659,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, @@ -2228,6 +2261,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)