aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_pm.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-08-24 11:26:20 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-09-03 04:09:28 -0400
commit5ab140a4ac08c895b67c2755e6f988ea92b5818b (patch)
tree5b21f68b6c31ba6bfc13188c5f80fb9549e71c86 /drivers/gpu/drm/i915/intel_pm.c
parentbe2cde9a6d922e5e43efd2ad39bc43ce70a5d79b (diff)
drm/i915: align vlv forcewake with common lore
For some odd reasons, the vlv forcewake code is rather different from all other platforms, with no clear justification. Adjust things: - Don't check whether the gt is awake already (and bail out early), we need to grab a forcewake anyway. Otherwise the chip might go to sleep too early. And this would also screw up our forcewake accounting. - Like all other platforms, check whether the gt has cleared the forcewake bit in the _ACK register before setting it again. - Use _MASKED_BIT_ENABLE/DISABLE macros - Only use bit0 of the forcewake reg, not all 16 bits. - check the gtfifodb reg like on all other platforms in _put. - Drop the POSTING_READs for consistency. v2: Failure to git add ... again. v3: Fixup the spelling fail a bit. Tested-by: "Purushothaman, Vijay A" <vijay.a.purushothaman@intel.com> Tested-by: "Widawsky, Benjamin" <benjamin.widawsky@intel.com> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_pm.c')
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 7ae35821121..82f74f36d55 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4069,12 +4069,10 @@ int __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv)
4069 4069
4070static void vlv_force_wake_get(struct drm_i915_private *dev_priv) 4070static void vlv_force_wake_get(struct drm_i915_private *dev_priv)
4071{ 4071{
4072 /* Already awake? */ 4072 if (wait_for_atomic_us((I915_READ_NOTRACE(FORCEWAKE_ACK_VLV) & 1) == 0, 500))
4073 if ((I915_READ(0x130094) & 0xa1) == 0xa1) 4073 DRM_ERROR("Force wake wait timed out\n");
4074 return;
4075 4074
4076 I915_WRITE_NOTRACE(FORCEWAKE_VLV, 0xffffffff); 4075 I915_WRITE_NOTRACE(FORCEWAKE_VLV, _MASKED_BIT_ENABLE(1));
4077 POSTING_READ(FORCEWAKE_VLV);
4078 4076
4079 if (wait_for_atomic_us((I915_READ_NOTRACE(FORCEWAKE_ACK_VLV) & 1), 500)) 4077 if (wait_for_atomic_us((I915_READ_NOTRACE(FORCEWAKE_ACK_VLV) & 1), 500))
4080 DRM_ERROR("Force wake wait timed out\n"); 4078 DRM_ERROR("Force wake wait timed out\n");
@@ -4084,9 +4082,9 @@ static void vlv_force_wake_get(struct drm_i915_private *dev_priv)
4084 4082
4085static void vlv_force_wake_put(struct drm_i915_private *dev_priv) 4083static void vlv_force_wake_put(struct drm_i915_private *dev_priv)
4086{ 4084{
4087 I915_WRITE_NOTRACE(FORCEWAKE_VLV, 0xffff0000); 4085 I915_WRITE_NOTRACE(FORCEWAKE_VLV, _MASKED_BIT_DISABLE(1));
4088 /* FIXME: confirm VLV behavior with Punit folks */ 4086 /* The below doubles as a POSTING_READ */
4089 POSTING_READ(FORCEWAKE_VLV); 4087 gen6_gt_check_fifodbg(dev_priv);
4090} 4088}
4091 4089
4092void intel_gt_init(struct drm_device *dev) 4090void intel_gt_init(struct drm_device *dev)