From: Jesse Barnes Subject: [PATCH 2/2] drm/i915: move gt powersave init out of save_state and modeset_init_hw Date: Fri, 11 Oct 2013 12:41:04 -0700 Message-ID: <1381520464-12521-2-git-send-email-jbarnes@virtuousgeek.org> References: <1381520464-12521-1-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from gproxy4-pub.mail.unifiedlayer.com (gproxy4-pub.mail.unifiedlayer.com [69.89.23.142]) by gabe.freedesktop.org (Postfix) with SMTP id EE1BCE8301 for ; Fri, 11 Oct 2013 12:41:07 -0700 (PDT) Received: from [67.161.37.189] (port=57072 helo=localhost.localdomain) by box514.bluehost.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.80) (envelope-from ) id 1VUiaB-0004uk-6L for intel-gfx@lists.freedesktop.org; Fri, 11 Oct 2013 13:41:07 -0600 In-Reply-To: <1381520464-12521-1-git-send-email-jbarnes@virtuousgeek.org> 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 We need to do this at init and resume time, but it's not modeset related. Since we'll need the modeset functions for managing save/restore after the power well is toggled, we want to keep them separate from GT related state save/restore to keep from affecting GT activity while the display is off. Signed-off-by: Jesse Barnes --- drivers/gpu/drm/i915/i915_dma.c | 2 ++ drivers/gpu/drm/i915/i915_drv.c | 3 +++ drivers/gpu/drm/i915/i915_suspend.c | 2 -- drivers/gpu/drm/i915/intel_display.c | 4 ---- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index f221631..313a8c9 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -1331,6 +1331,8 @@ static int i915_load_modeset_init(struct drm_device *dev) intel_modeset_gem_init(dev); + intel_enable_gt_powersave(dev); + /* Always safe in the mode setting case. */ /* FIXME: do pre/post-mode set stuff in core KMS code */ dev->vblank_disable_allowed = 1; diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 0fc9658..82a1d53 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -507,6 +507,8 @@ static int i915_drm_freeze(struct drm_device *dev) i915_save_state(dev); + intel_disable_gt_powersave(dev); + intel_opregion_fini(dev); console_lock(); @@ -604,6 +606,7 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings) mutex_lock(&dev->struct_mutex); error = i915_gem_init_hw(dev); + intel_enable_gt_powersave(dev); mutex_unlock(&dev->struct_mutex); /* We need working interrupts for modeset enabling ... */ diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index 98790c7..cd28fd5 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c @@ -395,8 +395,6 @@ int i915_save_state(struct drm_device *dev) } } - intel_disable_gt_powersave(dev); - /* Cache mode state */ if (INTEL_INFO(dev)->gen < 7) dev_priv->regfile.saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0); diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 5452b34..4835c51 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -10403,10 +10403,6 @@ void intel_modeset_init_hw(struct drm_device *dev) DPLL_INTEGRATED_CRI_CLK_VLV); intel_init_dpio(dev); - - mutex_lock(&dev->struct_mutex); - intel_enable_gt_powersave(dev); - mutex_unlock(&dev->struct_mutex); } void intel_modeset_suspend_hw(struct drm_device *dev) -- 1.8.3.1