From patchwork Tue Sep 15 00:31:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 47555 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8F0Va0M017674 for ; Tue, 15 Sep 2009 00:31:36 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6809F9EBDF; Mon, 14 Sep 2009 17:31:36 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from outbound-mail-313.bluehost.com (outbound-mail-313.bluehost.com [67.222.54.6]) by gabe.freedesktop.org (Postfix) with SMTP id 6B49F9E730 for ; Mon, 14 Sep 2009 17:31:34 -0700 (PDT) Received: (qmail 20057 invoked by uid 0); 15 Sep 2009 00:31:33 -0000 Received: from unknown (HELO box514.bluehost.com) (74.220.219.114) by outboundproxy6.bluehost.com with SMTP; 15 Sep 2009 00:31:33 -0000 Received: from [75.111.28.251] (helo=jbarnes-g45) by box514.bluehost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1MnLxF-0002SE-9d; Mon, 14 Sep 2009 18:31:33 -0600 Date: Mon, 14 Sep 2009 17:31:31 -0700 From: Jesse Barnes To: intel-gfx@lists.freedesktop.org, eric@anholt.net Message-ID: <20090914173131.5718b6e0@jbarnes-g45> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.17.5; i486-pc-linux-gnu) Mime-Version: 1.0 X-Identified-User: {10642:box514.bluehost.com:virtuous:virtuousgeek.org} {sentby:smtp auth 75.111.28.251 authed with jbarnes@virtuousgeek.org} Subject: [Intel-gfx] [PATCH] drm/i915: split i915_powersave into separate flags X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org From 04a037dd3c480a43744164c252f899d33f6b3944 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Mon, 14 Sep 2009 17:27:05 -0700 Subject: [PATCH] drm/i915: split power saving features Allows for easy measurement. Signed-off-by: Jesse Barnes --- drivers/gpu/drm/i915/i915_dma.c | 2 +- drivers/gpu/drm/i915/i915_drv.c | 2 +- drivers/gpu/drm/i915/i915_drv.h | 5 +++++ drivers/gpu/drm/i915/intel_display.c | 9 +++++---- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 8569e60..617a188 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -1205,7 +1205,7 @@ static int i915_load_modeset_init(struct drm_device *dev, /* Try to set up FBC with a reasonable compressed buffer size */ if (IS_MOBILE(dev) && (IS_I9XX(dev) || IS_I965G(dev) || IS_GM45(dev)) && - i915_powersave) { + (i915_powersave & I915_PM_FBC)) { int cfb_size; /* Try to get an 8M buffer... */ diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index dbe568c..c0953d6 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -43,7 +43,7 @@ module_param_named(modeset, i915_modeset, int, 0400); unsigned int i915_fbpercrtc = 0; module_param_named(fbpercrtc, i915_fbpercrtc, int, 0400); -unsigned int i915_powersave = 1; +unsigned int i915_powersave = ~0; module_param_named(powersave, i915_powersave, int, 0400); static struct drm_driver driver; diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index a174e5e..e77231e 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -615,6 +615,11 @@ enum intel_chip_family { extern struct drm_ioctl_desc i915_ioctls[]; extern int i915_max_ioctl; extern unsigned int i915_fbpercrtc; +#define I915_PM_RENDER_CLOCK (1<<0) +#define I915_PM_DISPLAY_CLOCK (1<<1) +#define I915_PM_PLL_CLOCK (1<<2) +#define I915_PM_SR (1<<3) +#define I915_PM_FBC (1<<4) extern unsigned int i915_powersave; extern int i915_master_create(struct drm_device *dev, struct drm_master *master); diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 421150a..714ce82 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -1120,7 +1120,7 @@ static void intel_update_fbc(struct drm_crtc *crtc, struct intel_crtc *intel_crtc = to_intel_crtc(crtc); int plane = intel_crtc->plane; - if (!i915_powersave) + if (!(i915_powersave & I915_PM_FBC)) return; if (!dev_priv->display.fbc_enabled || @@ -2416,7 +2416,7 @@ static void g4x_update_wm(struct drm_device *dev, int unused, int unused2, struct drm_i915_private *dev_priv = dev->dev_private; u32 fw_blc_self = I915_READ(FW_BLC_SELF); - if (i915_powersave) + if (i915_powersave & I915_PM_SR) fw_blc_self |= FW_BLC_SELF_EN; else fw_blc_self &= ~FW_BLC_SELF_EN; @@ -2958,7 +2958,8 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, udelay(150); } - if (is_lvds && has_reduced_clock && i915_powersave) { + if (is_lvds && has_reduced_clock && + (i915_powersave & I915_PM_PLL_CLOCK)) { I915_WRITE(fp_reg + 4, fp2); intel_crtc->lowfreq_avail = true; if (HAS_PIPE_CXSR(dev)) { @@ -3733,7 +3734,7 @@ static void intel_idle_update(struct work_struct *work) struct drm_crtc *crtc; struct intel_crtc *intel_crtc; - if (!i915_powersave) + if (!(i915_powersave & (I915_PM_RENDER_CLOCK | I915_PM_DISPLAY_CLOCK))) return; mutex_lock(&dev->struct_mutex);