diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2012-02-09 04:15:19 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-02-11 18:21:34 -0500 |
commit | ee64cbdbf617067988168a4a49fcaabdd2743da6 (patch) | |
tree | 7f2a84c6382c2d55832f19a5a8c1203e3ecf6a7c /drivers/gpu/drm/i915 | |
parent | dd202c6dd612beecf87b8b85c2f09b23f77364a2 (diff) |
drm/i915: catch gtfifo errors on forcewake_put
This is similar to a patch I wrote several months ago. It's been updated
for the new FORCEWAKE_MT. As recommended by Chris Wilson, use WARN()
instead of DRM_ERROR, so we can get a backtrace.
This shouldn't impact performance too much as the extra register read
can replace the POSTING_READ we had previously.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 189041984aba..d783e2b4c914 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -385,16 +385,27 @@ void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv) | |||
385 | spin_unlock_irqrestore(&dev_priv->gt_lock, irqflags); | 385 | spin_unlock_irqrestore(&dev_priv->gt_lock, irqflags); |
386 | } | 386 | } |
387 | 387 | ||
388 | static void gen6_gt_check_fifodbg(struct drm_i915_private *dev_priv) | ||
389 | { | ||
390 | u32 gtfifodbg; | ||
391 | gtfifodbg = I915_READ_NOTRACE(GTFIFODBG); | ||
392 | if (WARN(gtfifodbg & GT_FIFO_CPU_ERROR_MASK, | ||
393 | "MMIO read or write has been dropped %x\n", gtfifodbg)) | ||
394 | I915_WRITE_NOTRACE(GTFIFODBG, GT_FIFO_CPU_ERROR_MASK); | ||
395 | } | ||
396 | |||
388 | void __gen6_gt_force_wake_put(struct drm_i915_private *dev_priv) | 397 | void __gen6_gt_force_wake_put(struct drm_i915_private *dev_priv) |
389 | { | 398 | { |
390 | I915_WRITE_NOTRACE(FORCEWAKE, 0); | 399 | I915_WRITE_NOTRACE(FORCEWAKE, 0); |
391 | POSTING_READ(FORCEWAKE); | 400 | /* The below doubles as a POSTING_READ */ |
401 | gen6_gt_check_fifodbg(dev_priv); | ||
392 | } | 402 | } |
393 | 403 | ||
394 | void __gen6_gt_force_wake_mt_put(struct drm_i915_private *dev_priv) | 404 | void __gen6_gt_force_wake_mt_put(struct drm_i915_private *dev_priv) |
395 | { | 405 | { |
396 | I915_WRITE_NOTRACE(FORCEWAKE_MT, (1<<16) | 0); | 406 | I915_WRITE_NOTRACE(FORCEWAKE_MT, (1<<16) | 0); |
397 | POSTING_READ(FORCEWAKE_MT); | 407 | /* The below doubles as a POSTING_READ */ |
408 | gen6_gt_check_fifodbg(dev_priv); | ||
398 | } | 409 | } |
399 | 410 | ||
400 | /* | 411 | /* |