From: Chris Wilson Date: Tue, 27 Nov 2012 16:22:53 +0000 (+0000) Subject: drm/i915: Simplify flushing activity on the ring X-Git-Tag: v3.8-rc1~82^2^2~17 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=b662a0663230853fccdfceeda5db031f5d4b657c;p=linux.git 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 Reviewed-by: Mika Kuoppala Signed-off-by: Daniel Vetter --- 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) u32 seqno; int ret; - /* We need to add any requests required to flush the objects */ - if (!list_empty(&ring->active_list)) { - seqno = list_entry(ring->active_list.prev, - struct drm_i915_gem_object, - ring_list)->last_read_seqno; - - ret = i915_gem_check_olr(ring, seqno); + /* We need to add any requests required to flush the objects and ring */ + if (ring->outstanding_lazy_request) { + ret = i915_add_request(ring, NULL, NULL); if (ret) return ret; }