diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2013-03-08 13:45:57 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-03-23 07:17:58 -0400 |
commit | ed5de3995f9cdff997613f240e41033463703121 (patch) | |
tree | 5b2e6e2fd858df9426f1d50af24c6794f0cf514e | |
parent | da6ecc5decf6243a93dd0ecae4a4a773bf21dcce (diff) |
drm/i915: add media well to VLV force wake routines v2
We could split this out into a separate routine at some point as an
optimization.
v2: use FORCEWAKE_KERNEL (Ville)
Note: Ville mentioned in his review that he declines to be responsible
if this blows up due to the lack of "readback a register != FW_ACK,
but from the same cacheline" magic we have in other forcewake
implementations.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
[danvet: Bikeshed overtly long lines according to checkpatch.pl. Nope,
this time around I didn't screw up printk message since I've left
those alone.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 14 |
2 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 176cf5c58507..17cb78f5760a 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -4148,6 +4148,8 @@ | |||
4148 | #define FORCEWAKE 0xA18C | 4148 | #define FORCEWAKE 0xA18C |
4149 | #define FORCEWAKE_VLV 0x1300b0 | 4149 | #define FORCEWAKE_VLV 0x1300b0 |
4150 | #define FORCEWAKE_ACK_VLV 0x1300b4 | 4150 | #define FORCEWAKE_ACK_VLV 0x1300b4 |
4151 | #define FORCEWAKE_MEDIA_VLV 0x1300b8 | ||
4152 | #define FORCEWAKE_ACK_MEDIA_VLV 0x1300bc | ||
4151 | #define FORCEWAKE_ACK_HSW 0x130044 | 4153 | #define FORCEWAKE_ACK_HSW 0x130044 |
4152 | #define FORCEWAKE_ACK 0x130090 | 4154 | #define FORCEWAKE_ACK 0x130090 |
4153 | #define VLV_GTLC_WAKE_CTRL 0x130090 | 4155 | #define VLV_GTLC_WAKE_CTRL 0x130090 |
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index c30e89a45236..52d4f2d660db 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -4404,10 +4404,17 @@ static void vlv_force_wake_get(struct drm_i915_private *dev_priv) | |||
4404 | DRM_ERROR("Timed out waiting for forcewake old ack to clear.\n"); | 4404 | DRM_ERROR("Timed out waiting for forcewake old ack to clear.\n"); |
4405 | 4405 | ||
4406 | I915_WRITE_NOTRACE(FORCEWAKE_VLV, _MASKED_BIT_ENABLE(FORCEWAKE_KERNEL)); | 4406 | I915_WRITE_NOTRACE(FORCEWAKE_VLV, _MASKED_BIT_ENABLE(FORCEWAKE_KERNEL)); |
4407 | I915_WRITE_NOTRACE(FORCEWAKE_MEDIA_VLV, | ||
4408 | _MASKED_BIT_ENABLE(FORCEWAKE_KERNEL)); | ||
4407 | 4409 | ||
4408 | if (wait_for_atomic((I915_READ_NOTRACE(FORCEWAKE_ACK_VLV) & FORCEWAKE_KERNEL), | 4410 | if (wait_for_atomic((I915_READ_NOTRACE(FORCEWAKE_ACK_VLV) & FORCEWAKE_KERNEL), |
4409 | FORCEWAKE_ACK_TIMEOUT_MS)) | 4411 | FORCEWAKE_ACK_TIMEOUT_MS)) |
4410 | DRM_ERROR("Timed out waiting for forcewake to ack request.\n"); | 4412 | DRM_ERROR("Timed out waiting for GT to ack forcewake request.\n"); |
4413 | |||
4414 | if (wait_for_atomic((I915_READ_NOTRACE(FORCEWAKE_ACK_MEDIA_VLV) & | ||
4415 | FORCEWAKE_KERNEL), | ||
4416 | FORCEWAKE_ACK_TIMEOUT_MS)) | ||
4417 | DRM_ERROR("Timed out waiting for media to ack forcewake request.\n"); | ||
4411 | 4418 | ||
4412 | __gen6_gt_wait_for_thread_c0(dev_priv); | 4419 | __gen6_gt_wait_for_thread_c0(dev_priv); |
4413 | } | 4420 | } |
@@ -4415,8 +4422,9 @@ static void vlv_force_wake_get(struct drm_i915_private *dev_priv) | |||
4415 | static void vlv_force_wake_put(struct drm_i915_private *dev_priv) | 4422 | static void vlv_force_wake_put(struct drm_i915_private *dev_priv) |
4416 | { | 4423 | { |
4417 | I915_WRITE_NOTRACE(FORCEWAKE_VLV, _MASKED_BIT_DISABLE(FORCEWAKE_KERNEL)); | 4424 | I915_WRITE_NOTRACE(FORCEWAKE_VLV, _MASKED_BIT_DISABLE(FORCEWAKE_KERNEL)); |
4418 | /* something from same cacheline, but !FORCEWAKE_VLV */ | 4425 | I915_WRITE_NOTRACE(FORCEWAKE_MEDIA_VLV, |
4419 | POSTING_READ(FORCEWAKE_ACK_VLV); | 4426 | _MASKED_BIT_DISABLE(FORCEWAKE_KERNEL)); |
4427 | /* The below doubles as a POSTING_READ */ | ||
4420 | gen6_gt_check_fifodbg(dev_priv); | 4428 | gen6_gt_check_fifodbg(dev_priv); |
4421 | } | 4429 | } |
4422 | 4430 | ||