From patchwork Tue Jun 30 18:28:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 6698001 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C29E6C05AC for ; Tue, 30 Jun 2015 18:29:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E502F20605 for ; Tue, 30 Jun 2015 18:29:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 10E922038E for ; Tue, 30 Jun 2015 18:29:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 75E4E6EA1E; Tue, 30 Jun 2015 11:29:15 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id DA4636EA1E for ; Tue, 30 Jun 2015 11:29:11 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 30 Jun 2015 11:29:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,379,1432623600"; d="scan'208";a="737894757" Received: from amunshi-mobl4.amr.corp.intel.com (HELO strange.amr.corp.intel.com) ([10.254.100.153]) by fmsmga001.fm.intel.com with ESMTP; 30 Jun 2015 11:29:10 -0700 From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Tue, 30 Jun 2015 19:28:59 +0100 Message-Id: <1435688939-26523-7-git-send-email-damien.lespiau@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1435688939-26523-1-git-send-email-damien.lespiau@intel.com> References: <1435688939-26523-1-git-send-email-damien.lespiau@intel.com> Subject: [Intel-gfx] [PATCH 6/6] drm/i915/bxt: Print out if we allow DC9 in debugfs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Just like the DC5/DC6 states on SKL, but this time for BXT's DC9. Signed-off-by: Damien Lespiau --- drivers/gpu/drm/i915/i915_debugfs.c | 1 + drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/intel_runtime_pm.c | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 878cc7f..0bc8b37 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -2626,6 +2626,7 @@ static int i915_dmc_info(struct seq_file *m, void *unused) mutex_lock(&csr->lock); seq_printf(m, "DC5 allowed: %s\n", yesno(csr->dc5_allowed)); seq_printf(m, "DC6 allowed: %s\n", yesno(csr->dc6_allowed)); + seq_printf(m, "DC9 allowed: %s\n", yesno(csr->dc9_allowed)); mutex_unlock(&csr->lock); if (IS_SKYLAKE(dev) && csr->version >= CSR_VERSION(1, 6)) { diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 99a09dd..129e148 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -751,7 +751,7 @@ struct intel_csr { uint32_t mmioaddr[8]; uint32_t mmiodata[8]; enum csr_state state; - bool dc5_allowed, dc6_allowed; + bool dc5_allowed, dc6_allowed, dc9_allowed; }; #define DEV_INFO_FOR_EACH_FLAG(func, sep) \ diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c index bfcc990..31f003a4 100644 --- a/drivers/gpu/drm/i915/intel_runtime_pm.c +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c @@ -415,6 +415,7 @@ static void assert_can_disable_dc9(struct drm_i915_private *dev_priv) void bxt_enable_dc9(struct drm_i915_private *dev_priv) { + struct intel_csr *csr = &dev_priv->csr; uint32_t val; assert_can_enable_dc9(dev_priv); @@ -425,10 +426,15 @@ void bxt_enable_dc9(struct drm_i915_private *dev_priv) val |= DC_STATE_EN_DC9; I915_WRITE(DC_STATE_EN, val); POSTING_READ(DC_STATE_EN); + + mutex_lock(&csr->lock); + csr->dc9_allowed = true; + mutex_unlock(&csr->lock); } void bxt_disable_dc9(struct drm_i915_private *dev_priv) { + struct intel_csr *csr = &dev_priv->csr; uint32_t val; assert_can_disable_dc9(dev_priv); @@ -439,6 +445,10 @@ void bxt_disable_dc9(struct drm_i915_private *dev_priv) val &= ~DC_STATE_EN_DC9; I915_WRITE(DC_STATE_EN, val); POSTING_READ(DC_STATE_EN); + + mutex_lock(&csr->lock); + csr->dc9_allowed = false; + mutex_unlock(&csr->lock); } static void gen9_set_dc_state_debugmask_memory_up(