aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2011-12-14 07:56:59 -0500
committerKeith Packard <keithp@keithp.com>2012-01-03 13:26:31 -0500
commite6bfaf854272ec4641a9ef7b1cb1ca963031ba95 (patch)
tree8900222b0f6cbe1b44c5fedba2d4457259aacfa9 /drivers/gpu/drm/i915
parent4e0e90dcb8a7df1229c69e30abebb59b0b3c2a1f (diff)
drm/i915: don't bail out of intel_wait_ring_buffer too early
In the pre-gem days with non-existing hangcheck and gpu reset code, this timeout of 3 seconds was pretty important to avoid stuck processes. But now we have the hangcheck code in gem that goes to great length to ensure that the gpu is really dead before declaring it wedged. So there's no need for this timeout anymore. Actually it's even harmful because we can bail out too early (e.g. with xscreensaver slip) when running giant batchbuffers. And our code isn't robust enough to properly unroll any state-changes, we pretty much rely on the gpu reset code cleaning up the mess (like cache tracking, fencing state, active list/request tracking, ...). With this change intel_begin_ring can only fail when the gpu is wedged, and it will return -EAGAIN (like wait_request in case the gpu reset is still outstanding). v2: Chris Wilson noted that on resume timers aren't running and hence we won't ever get kicked out of this loop by the hangcheck code. Use an insanely large timeout instead for the HAS_GEM case to prevent resume bugs from totally hanging the machine. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index d0eb2280d8d9..77e729d4e4f0 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -1135,7 +1135,16 @@ int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n)
1135 } 1135 }
1136 1136
1137 trace_i915_ring_wait_begin(ring); 1137 trace_i915_ring_wait_begin(ring);
1138 end = jiffies + 3 * HZ; 1138 if (drm_core_check_feature(dev, DRIVER_GEM))
1139 /* With GEM the hangcheck timer should kick us out of the loop,
1140 * leaving it early runs the risk of corrupting GEM state (due
1141 * to running on almost untested codepaths). But on resume
1142 * timers don't work yet, so prevent a complete hang in that
1143 * case by choosing an insanely large timeout. */
1144 end = jiffies + 60 * HZ;
1145 else
1146 end = jiffies + 3 * HZ;
1147
1139 do { 1148 do {
1140 ring->head = I915_READ_HEAD(ring); 1149 ring->head = I915_READ_HEAD(ring);
1141 ring->space = ring_space(ring); 1150 ring->space = ring_space(ring);