diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-11-22 08:07:20 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-11-29 05:43:51 -0500 |
commit | b5d177946a30b097fbd1e5afa7c11acdeeb6bad8 (patch) | |
tree | 205bb42a43314948eea1eb6b5e32abca6b39721c /drivers/gpu/drm | |
parent | 4f1ba0f83a6d4abd055cf75af43954b38df8dcaf (diff) |
drm/i915: Wait upon the last request seqno, rather than a future seqno
In commit 69c2fc891343cb5217c866d10709343cff190bdc
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Jul 20 12:41:03 2012 +0100
drm/i915: Remove the per-ring write list
the explicit flush was removed from i915_ring_idle(). However, we
continued to wait upon the next seqno which now did not correspond to
any request (except for the unusual condition of a failure to queue a
request after execbuffer) and so would wait indefinitely.
This has an important side-effect that i915_gpu_idle() does not cause
the seqno to be incremented. This is vital if we are to be able to idle
the GPU to handle seqno wraparound, as in subsequent patches.
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>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index b0016bb6563..9be450e7c54 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2462,10 +2462,29 @@ i915_gem_object_unbind(struct drm_i915_gem_object *obj) | |||
2462 | 2462 | ||
2463 | static int i915_ring_idle(struct intel_ring_buffer *ring) | 2463 | static int i915_ring_idle(struct intel_ring_buffer *ring) |
2464 | { | 2464 | { |
2465 | if (list_empty(&ring->active_list)) | 2465 | u32 seqno; |
2466 | int ret; | ||
2467 | |||
2468 | /* We need to add any requests required to flush the objects */ | ||
2469 | if (!list_empty(&ring->active_list)) { | ||
2470 | seqno = list_entry(ring->active_list.prev, | ||
2471 | struct drm_i915_gem_object, | ||
2472 | ring_list)->last_read_seqno; | ||
2473 | |||
2474 | ret = i915_gem_check_olr(ring, seqno); | ||
2475 | if (ret) | ||
2476 | return ret; | ||
2477 | } | ||
2478 | |||
2479 | /* Wait upon the last request to be completed */ | ||
2480 | if (list_empty(&ring->request_list)) | ||
2466 | return 0; | 2481 | return 0; |
2467 | 2482 | ||
2468 | return i915_wait_seqno(ring, i915_gem_next_request_seqno(ring)); | 2483 | seqno = list_entry(ring->request_list.prev, |
2484 | struct drm_i915_gem_request, | ||
2485 | list)->seqno; | ||
2486 | |||
2487 | return i915_wait_seqno(ring, seqno); | ||
2469 | } | 2488 | } |
2470 | 2489 | ||
2471 | int i915_gpu_idle(struct drm_device *dev) | 2490 | int i915_gpu_idle(struct drm_device *dev) |