aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-12-08 12:32:24 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2010-12-09 14:46:24 -0500
commiteb43f4af7ecb7d51ba44f5e96bf74eedf1c27d62 (patch)
tree7adf22c19151445e02efef5670b5495223396801 /drivers/gpu/drm/i915/i915_drv.h
parenta8e93126a6f10d0a14ba8407ec112b1b3a5e2e97 (diff)
drm/i915: Terminate the FORCE WAKE after we have finished reading
Once we have read the value out of the GT power well, we need to remove the FORCE WAKE bit to allow the system to auto-power down. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index b8a55008a1b5..30780f2cab6f 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1341,17 +1341,20 @@ __i915_write(64, q)
1341 * must be set to prevent GT core from power down and stale values being 1341 * must be set to prevent GT core from power down and stale values being
1342 * returned. 1342 * returned.
1343 */ 1343 */
1344void __gen6_force_wake_get(struct drm_i915_private *dev_priv);
1345void __gen6_force_wake_put (struct drm_i915_private *dev_priv);
1344static inline u32 i915_safe_read(struct drm_i915_private *dev_priv, u32 reg) 1346static inline u32 i915_safe_read(struct drm_i915_private *dev_priv, u32 reg)
1345{ 1347{
1346 if (IS_GEN6(dev_priv->dev)) { 1348 u32 val;
1347 I915_WRITE_NOTRACE(FORCEWAKE, 1); 1349
1348 POSTING_READ(FORCEWAKE); 1350 if (dev_priv->info->gen >= 6) {
1349 /* XXX How long do we really need to wait here? 1351 __gen6_force_wake_get(dev_priv);
1350 * Will different registers/engines require different periods? 1352 val = I915_READ(reg);
1351 */ 1353 __gen6_force_wake_put(dev_priv);
1352 udelay(100); 1354 } else
1353 } 1355 val = I915_READ(reg);
1354 return I915_READ(reg); 1356
1357 return val;
1355} 1358}
1356 1359
1357static inline void 1360static inline void