diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-09-09 14:12:00 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-09-09 14:23:08 +0100 |
commit | 0a046a0e93d2971d42f975b7ac409af0d4d9e7b4 (patch) | |
tree | 74af67b35ad8bc00c8484fce8154e43d4229fee0 /drivers/gpu/drm/i915/i915_gem_request.c | |
parent | 32c2b4bda62839c527b47bc843aebcdd535c9519 (diff) | |
download | blackbird-op-linux-0a046a0e93d2971d42f975b7ac409af0d4d9e7b4.tar.gz blackbird-op-linux-0a046a0e93d2971d42f975b7ac409af0d4d9e7b4.zip |
drm/i915: Nonblocking request submission
Now that we have fences in place to drive request submission, we can
employ those to queue requests after their dependencies as opposed to
stalling in the middle of an execbuf ioctl. (However, we still choose to
spin before enabling the IRQ as that is faster - though contentious.)
v2: Do the fence ordering first, where we can still fail.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20160909131201.16673-20-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_request.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_request.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c index 017cadf54d80..40978bc12ceb 100644 --- a/drivers/gpu/drm/i915/i915_gem_request.c +++ b/drivers/gpu/drm/i915/i915_gem_request.c @@ -477,12 +477,13 @@ i915_gem_request_await_request(struct drm_i915_gem_request *to, trace_i915_gem_ring_sync_to(to, from); if (!i915.semaphores) { - ret = i915_wait_request(from, - I915_WAIT_INTERRUPTIBLE | - I915_WAIT_LOCKED, - NULL, NO_WAITBOOST); - if (ret) - return ret; + if (!i915_spin_request(from, TASK_INTERRUPTIBLE, 2)) { + ret = i915_sw_fence_await_dma_fence(&to->submit, + &from->fence, 0, + GFP_KERNEL); + if (ret < 0) + return ret; + } } else { ret = to->engine->semaphore.sync_to(to, from); if (ret) @@ -577,6 +578,7 @@ void __i915_add_request(struct drm_i915_gem_request *request, bool flush_caches) { struct intel_engine_cs *engine = request->engine; struct intel_ring *ring = request->ring; + struct drm_i915_gem_request *prev; u32 request_start; u32 reserved_tail; int ret; @@ -631,6 +633,13 @@ void __i915_add_request(struct drm_i915_gem_request *request, bool flush_caches) * hangcheck. Hence we apply the barrier to ensure that we do not * see a more recent value in the hws than we are tracking. */ + + prev = i915_gem_active_raw(&engine->last_request, + &request->i915->drm.struct_mutex); + if (prev) + i915_sw_fence_await_sw_fence(&request->submit, &prev->submit, + &request->submitq); + request->emitted_jiffies = jiffies; request->previous_seqno = engine->last_submitted_seqno; engine->last_submitted_seqno = request->fence.seqno; |