diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-11-27 11:22:53 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-11-29 05:43:53 -0500 |
commit | b662a0663230853fccdfceeda5db031f5d4b657c (patch) | |
tree | 4c5d4cab41b4008e44d5553ffa48aa19b591d6d8 /drivers/gpu | |
parent | 9d7730914f4cd496e356acfab95b41075aa8eae8 (diff) |
drm/i915: Simplify flushing activity on the ring
As we now always preallocate the seqno before writing to the ring, we
can trivially test if we have any pending activity on the ring by
inspecting the olr. This makes it then possible to flush operations that
are not normally associated with a request, like power-management.
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')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 3b9b250ceac4..e594435eec9d 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2485,13 +2485,9 @@ static int i915_ring_idle(struct intel_ring_buffer *ring) | |||
2485 | u32 seqno; | 2485 | u32 seqno; |
2486 | int ret; | 2486 | int ret; |
2487 | 2487 | ||
2488 | /* We need to add any requests required to flush the objects */ | 2488 | /* We need to add any requests required to flush the objects and ring */ |
2489 | if (!list_empty(&ring->active_list)) { | 2489 | if (ring->outstanding_lazy_request) { |
2490 | seqno = list_entry(ring->active_list.prev, | 2490 | ret = i915_add_request(ring, NULL, NULL); |
2491 | struct drm_i915_gem_object, | ||
2492 | ring_list)->last_read_seqno; | ||
2493 | |||
2494 | ret = i915_gem_check_olr(ring, seqno); | ||
2495 | if (ret) | 2491 | if (ret) |
2496 | return ret; | 2492 | return ret; |
2497 | } | 2493 | } |