Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 228801
b: refs/heads/master
c: eb43f4a
h: refs/heads/master
i:
  228799: e48b784
v: v3
  • Loading branch information
Chris Wilson committed Dec 9, 2010
1 parent 0d19a47 commit 36aaf8d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a8e93126a6f10d0a14ba8407ec112b1b3a5e2e97
refs/heads/master: eb43f4af7ecb7d51ba44f5e96bf74eedf1c27d62
22 changes: 22 additions & 0 deletions trunk/drivers/gpu/drm/i915/i915_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,28 @@ void intel_detect_pch (struct drm_device *dev)
}
}

void __gen6_force_wake_get(struct drm_i915_private *dev_priv)
{
int count;

count = 0;
while (count++ < 50 && (I915_READ_NOTRACE(FORCEWAKE_ACK) & 1))
udelay(10);

I915_WRITE_NOTRACE(FORCEWAKE, 1);
POSTING_READ(FORCEWAKE);

count = 0;
while (count++ < 50 && (I915_READ_NOTRACE(FORCEWAKE_ACK) & 1) == 0)
udelay(10);
}

void __gen6_force_wake_put(struct drm_i915_private *dev_priv)
{
I915_WRITE_NOTRACE(FORCEWAKE, 0);
POSTING_READ(FORCEWAKE);
}

static int i915_drm_freeze(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
Expand Down
21 changes: 12 additions & 9 deletions trunk/drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1341,17 +1341,20 @@ __i915_write(64, q)
* must be set to prevent GT core from power down and stale values being
* returned.
*/
void __gen6_force_wake_get(struct drm_i915_private *dev_priv);
void __gen6_force_wake_put (struct drm_i915_private *dev_priv);
static inline u32 i915_safe_read(struct drm_i915_private *dev_priv, u32 reg)
{
if (IS_GEN6(dev_priv->dev)) {
I915_WRITE_NOTRACE(FORCEWAKE, 1);
POSTING_READ(FORCEWAKE);
/* XXX How long do we really need to wait here?
* Will different registers/engines require different periods?
*/
udelay(100);
}
return I915_READ(reg);
u32 val;

if (dev_priv->info->gen >= 6) {
__gen6_force_wake_get(dev_priv);
val = I915_READ(reg);
__gen6_force_wake_put(dev_priv);
} else
val = I915_READ(reg);

return val;
}

static inline void
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/gpu/drm/i915/i915_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -3115,4 +3115,5 @@
#define EDP_LINK_TRAIN_VOL_EMP_MASK_SNB (0x3f<<22)

#define FORCEWAKE 0xA18C
#define FORCEWAKE_ACK 0x130090
#endif /* _I915_REG_H_ */

0 comments on commit 36aaf8d

Please sign in to comment.