Skip to content

Commit

Permalink
drm/i915: Open-code i915_gpu_idle() for handling seqno wrapping
Browse files Browse the repository at this point in the history
The complication is that during seqno wrapping we must be extremely
careful not to write to any ring as that will require a new seqno, and
so would recurse back into the seqno wrap handler. So we cannot call
i915_gpu_idle() as that does additional work beyond simply retiring the
current set of requests, and instead must do the minimal work ourselves
during seqno wrapping.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Chris Wilson authored and Daniel Vetter committed Dec 11, 2012
1 parent f72b343 commit 107f27a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1938,11 +1938,15 @@ i915_gem_handle_seqno_wrap(struct drm_device *dev)
if (ret == 0)
return ret;

ret = i915_gpu_idle(dev);
if (ret)
return ret;

/* Carefully retire all requests without writing to the rings */
for_each_ring(ring, dev_priv, i) {
ret = intel_ring_idle(ring);
if (ret)
return ret;
}
i915_gem_retire_requests(dev);

/* Finally reset hw state */
for_each_ring(ring, dev_priv, i) {
ret = intel_ring_handle_seqno_wrap(ring);
if (ret)
Expand Down

0 comments on commit 107f27a

Please sign in to comment.