diff options
-rw-r--r-- | drivers/gpu/drm/i915/i915_suspend.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 55 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 3 |
3 files changed, 36 insertions, 26 deletions
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index 011325e51e3a..a311809f3c80 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c | |||
@@ -820,6 +820,8 @@ int i915_save_state(struct drm_device *dev) | |||
820 | if (HAS_PCH_SPLIT(dev)) | 820 | if (HAS_PCH_SPLIT(dev)) |
821 | ironlake_disable_drps(dev); | 821 | ironlake_disable_drps(dev); |
822 | 822 | ||
823 | intel_disable_clock_gating(dev); | ||
824 | |||
823 | /* Cache mode state */ | 825 | /* Cache mode state */ |
824 | dev_priv->saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0); | 826 | dev_priv->saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0); |
825 | 827 | ||
@@ -863,7 +865,7 @@ int i915_restore_state(struct drm_device *dev) | |||
863 | } | 865 | } |
864 | 866 | ||
865 | /* Clock gating state */ | 867 | /* Clock gating state */ |
866 | intel_init_clock_gating(dev); | 868 | intel_enable_clock_gating(dev); |
867 | 869 | ||
868 | if (HAS_PCH_SPLIT(dev)) { | 870 | if (HAS_PCH_SPLIT(dev)) { |
869 | ironlake_enable_drps(dev); | 871 | ironlake_enable_drps(dev); |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index aba1c33f6407..31fc1d797f8f 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -5828,7 +5828,7 @@ void intel_init_emon(struct drm_device *dev) | |||
5828 | dev_priv->corr = (lcfuse & LCFUSE_HIV_MASK); | 5828 | dev_priv->corr = (lcfuse & LCFUSE_HIV_MASK); |
5829 | } | 5829 | } |
5830 | 5830 | ||
5831 | void intel_init_clock_gating(struct drm_device *dev) | 5831 | void intel_enable_clock_gating(struct drm_device *dev) |
5832 | { | 5832 | { |
5833 | struct drm_i915_private *dev_priv = dev->dev_private; | 5833 | struct drm_i915_private *dev_priv = dev->dev_private; |
5834 | 5834 | ||
@@ -5985,6 +5985,33 @@ void intel_init_clock_gating(struct drm_device *dev) | |||
5985 | } | 5985 | } |
5986 | } | 5986 | } |
5987 | 5987 | ||
5988 | void intel_disable_clock_gating(struct drm_device *dev) | ||
5989 | { | ||
5990 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
5991 | |||
5992 | if (dev_priv->renderctx) { | ||
5993 | struct drm_i915_gem_object *obj = dev_priv->renderctx; | ||
5994 | |||
5995 | I915_WRITE(CCID, 0); | ||
5996 | POSTING_READ(CCID); | ||
5997 | |||
5998 | i915_gem_object_unpin(obj); | ||
5999 | drm_gem_object_unreference(&obj->base); | ||
6000 | dev_priv->renderctx = NULL; | ||
6001 | } | ||
6002 | |||
6003 | if (dev_priv->pwrctx) { | ||
6004 | struct drm_i915_gem_object *obj = dev_priv->pwrctx; | ||
6005 | |||
6006 | I915_WRITE(PWRCTXA, 0); | ||
6007 | POSTING_READ(PWRCTXA); | ||
6008 | |||
6009 | i915_gem_object_unpin(obj); | ||
6010 | drm_gem_object_unreference(&obj->base); | ||
6011 | dev_priv->pwrctx = NULL; | ||
6012 | } | ||
6013 | } | ||
6014 | |||
5988 | /* Set up chip specific display functions */ | 6015 | /* Set up chip specific display functions */ |
5989 | static void intel_init_display(struct drm_device *dev) | 6016 | static void intel_init_display(struct drm_device *dev) |
5990 | { | 6017 | { |
@@ -6211,7 +6238,7 @@ void intel_modeset_init(struct drm_device *dev) | |||
6211 | 6238 | ||
6212 | intel_setup_outputs(dev); | 6239 | intel_setup_outputs(dev); |
6213 | 6240 | ||
6214 | intel_init_clock_gating(dev); | 6241 | intel_enable_clock_gating(dev); |
6215 | 6242 | ||
6216 | /* Just disable it once at startup */ | 6243 | /* Just disable it once at startup */ |
6217 | i915_disable_vga(dev); | 6244 | i915_disable_vga(dev); |
@@ -6252,31 +6279,11 @@ void intel_modeset_cleanup(struct drm_device *dev) | |||
6252 | if (dev_priv->display.disable_fbc) | 6279 | if (dev_priv->display.disable_fbc) |
6253 | dev_priv->display.disable_fbc(dev); | 6280 | dev_priv->display.disable_fbc(dev); |
6254 | 6281 | ||
6255 | if (dev_priv->renderctx) { | ||
6256 | struct drm_i915_gem_object *obj = dev_priv->renderctx; | ||
6257 | |||
6258 | I915_WRITE(CCID, obj->gtt_offset &~ CCID_EN); | ||
6259 | POSTING_READ(CCID); | ||
6260 | |||
6261 | i915_gem_object_unpin(obj); | ||
6262 | drm_gem_object_unreference(&obj->base); | ||
6263 | dev_priv->renderctx = NULL; | ||
6264 | } | ||
6265 | |||
6266 | if (dev_priv->pwrctx) { | ||
6267 | struct drm_i915_gem_object *obj = dev_priv->pwrctx; | ||
6268 | |||
6269 | I915_WRITE(PWRCTXA, obj->gtt_offset &~ PWRCTX_EN); | ||
6270 | POSTING_READ(PWRCTXA); | ||
6271 | |||
6272 | i915_gem_object_unpin(obj); | ||
6273 | drm_gem_object_unreference(&obj->base); | ||
6274 | dev_priv->pwrctx = NULL; | ||
6275 | } | ||
6276 | |||
6277 | if (IS_IRONLAKE_M(dev)) | 6282 | if (IS_IRONLAKE_M(dev)) |
6278 | ironlake_disable_drps(dev); | 6283 | ironlake_disable_drps(dev); |
6279 | 6284 | ||
6285 | intel_disable_clock_gating(dev); | ||
6286 | |||
6280 | mutex_unlock(&dev->struct_mutex); | 6287 | mutex_unlock(&dev->struct_mutex); |
6281 | 6288 | ||
6282 | /* Disable the irq before mode object teardown, for the irq might | 6289 | /* Disable the irq before mode object teardown, for the irq might |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 7273c9e7e0dc..acdea6549ec4 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -294,7 +294,8 @@ extern void intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green, | |||
294 | u16 blue, int regno); | 294 | u16 blue, int regno); |
295 | extern void intel_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, | 295 | extern void intel_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, |
296 | u16 *blue, int regno); | 296 | u16 *blue, int regno); |
297 | extern void intel_init_clock_gating(struct drm_device *dev); | 297 | extern void intel_enable_clock_gating(struct drm_device *dev); |
298 | extern void intel_disable_clock_gating(struct drm_device *dev); | ||
298 | extern void ironlake_enable_drps(struct drm_device *dev); | 299 | extern void ironlake_enable_drps(struct drm_device *dev); |
299 | extern void ironlake_disable_drps(struct drm_device *dev); | 300 | extern void ironlake_disable_drps(struct drm_device *dev); |
300 | extern void intel_init_emon(struct drm_device *dev); | 301 | extern void intel_init_emon(struct drm_device *dev); |