From 6f677120f916daca5917e39ec059f1c9ae204d37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Fri, 16 Jan 2015 20:37:03 +0200 Subject: [PATCH] drm/i915: Skip all the gfx clock force on CHV MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gfx clock forcing seems to be needed only to perform the Gunit register save/restore. On CHV that's supposedly done by the hardware so we should just skip all of it in the driver. Cc: Kevin Strasser Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87086 Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/i915_drv.c | 50 +++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 6f4f3c5..77daaaa 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -1300,20 +1300,21 @@ static int vlv_suspend_complete(struct drm_i915_private *dev_priv) vlv_check_no_gt_access(dev_priv); - err = vlv_force_gfx_clock(dev_priv, true); - if (err) - goto err1; + if (!IS_CHERRYVIEW(dev_priv)) { + err = vlv_force_gfx_clock(dev_priv, true); + if (err) + goto err1; - err = vlv_allow_gt_wake(dev_priv, false); - if (err) - goto err2; + err = vlv_allow_gt_wake(dev_priv, false); + if (err) + goto err2; - if (!IS_CHERRYVIEW(dev_priv->dev)) vlv_save_gunit_s0ix_state(dev_priv); - err = vlv_force_gfx_clock(dev_priv, false); - if (err) - goto err2; + err = vlv_force_gfx_clock(dev_priv, false); + if (err) + goto err2; + } return 0; @@ -1331,25 +1332,26 @@ static int vlv_resume_prepare(struct drm_i915_private *dev_priv, { struct drm_device *dev = dev_priv->dev; int err; - int ret; + int ret = 0; - /* - * If any of the steps fail just try to continue, that's the best we - * can do at this point. Return the first error code (which will also - * leave RPM permanently disabled). - */ - ret = vlv_force_gfx_clock(dev_priv, true); + if (!IS_CHERRYVIEW(dev_priv)) { + /* + * If any of the steps fail just try to continue, that's the best we + * can do at this point. Return the first error code (which will also + * leave RPM permanently disabled). + */ + ret = vlv_force_gfx_clock(dev_priv, true); - if (!IS_CHERRYVIEW(dev_priv->dev)) vlv_restore_gunit_s0ix_state(dev_priv); - err = vlv_allow_gt_wake(dev_priv, true); - if (!ret) - ret = err; + err = vlv_allow_gt_wake(dev_priv, true); + if (!ret) + ret = err; - err = vlv_force_gfx_clock(dev_priv, false); - if (!ret) - ret = err; + err = vlv_force_gfx_clock(dev_priv, false); + if (!ret) + ret = err; + } vlv_check_no_gt_access(dev_priv); -- 2.0.5