From patchwork Mon May 5 12:47:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: deepak.s@linux.intel.com X-Patchwork-Id: 4114701 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B5D4B9F271 for ; Mon, 5 May 2014 12:48:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D7B7B20218 for ; Mon, 5 May 2014 12:48:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EB0C320200 for ; Mon, 5 May 2014 12:48:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 66A766E89B; Mon, 5 May 2014 05:48:09 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id B03376E89B for ; Mon, 5 May 2014 05:48:08 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by azsmga101.ch.intel.com with ESMTP; 05 May 2014 05:48:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,988,1389772800"; d="scan'208";a="526183640" Received: from ds1-mobl1.gar.corp.intel.com (HELO deepaks.iind.intel.com) ([10.223.184.86]) by fmsmga001.fm.intel.com with ESMTP; 05 May 2014 05:48:02 -0700 From: deepak.s@linux.intel.com To: intel-gfx@lists.freedesktop.org Date: Mon, 5 May 2014 18:17:39 +0530 Message-Id: <1399294059-20748-11-git-send-email-deepak.s@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1399294059-20748-1-git-send-email-deepak.s@linux.intel.com> References: <1399294059-20748-1-git-send-email-deepak.s@linux.intel.com> Cc: fafael.barbalho@intel.com Subject: [Intel-gfx] [PATCH 10/10] drm/i915/chv: Freq(opcode) request for CHV. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 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 From: Deepak S On CHV, All the freq request should be even. So, we need to make sure we request the opcode accordingly. Signed-off-by: Deepak S Reviewed-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_irq.c | 9 +++++++-- drivers/gpu/drm/i915/i915_reg.h | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index e70a9f0..3966ff2 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1318,6 +1318,7 @@ struct drm_i915_private { u32 gt_irq_mask; u32 pm_irq_mask; u32 pm_rps_events; + u32 pm_rps_freq_req; u32 pipestat_irq_mask[I915_MAX_PIPES]; struct work_struct hotplug_work; diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 6af51ad..3e8bcca 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1162,7 +1162,7 @@ static void gen6_pm_rps_work(struct work_struct *work) if (adj > 0) adj *= 2; else - adj = 1; + adj = dev_priv->pm_rps_freq_req; new_delay = dev_priv->rps.cur_freq + adj; /* @@ -1181,7 +1181,7 @@ static void gen6_pm_rps_work(struct work_struct *work) if (adj < 0) adj *= 2; else - adj = -1; + adj = -1 * dev_priv->pm_rps_freq_req; new_delay = dev_priv->rps.cur_freq + adj; } else { /* unknown event */ new_delay = dev_priv->rps.cur_freq; @@ -4088,6 +4088,11 @@ void intel_irq_init(struct drm_device *dev) /* Let's track the enabled rps events */ dev_priv->pm_rps_events = GEN6_PM_RPS_EVENTS; + if (IS_CHERRYVIEW(dev)) + dev_priv->pm_rps_freq_req = CHV_GPU_FREQ_REQ; + else + dev_priv->pm_rps_freq_req = GEN6_GPU_FREQ_REQ; + setup_timer(&dev_priv->gpu_error.hangcheck_timer, i915_hangcheck_elapsed, (unsigned long) dev); diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 3ff34c4..4998d6b 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -529,6 +529,9 @@ enum punit_power_well { #define CHV_FB_RPE_FREQ_SHIFT 8 #define CHV_FB_RPE_FREQ_MASK 0xff +#define CHV_GPU_FREQ_REQ 2 +#define GEN6_GPU_FREQ_REQ 1 + #define IOSF_NC_FB_GFX_FREQ_FUSE 0x1c #define FB_GFX_MAX_FREQ_FUSE_SHIFT 3 #define FB_GFX_MAX_FREQ_FUSE_MASK 0x000007f8