summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_request.c
diff options
context:
space:
mode:
authorChris Wilson2016-11-08 15:37:19 +0100
committerChris Wilson2016-11-09 16:01:52 +0100
commit6a5d1db98ef1da5c632640133898aa42d6916c6c (patch)
treeda7a2307777e38e2f990cc2bc5ddb89332c94be3 /drivers/gpu/drm/i915/i915_gem_request.c
parentdrm/i915: Pass atomic state to verify_connector_state (diff)
downloadkernel-qcow2-linux-6a5d1db98ef1da5c632640133898aa42d6916c6c.tar.gz
kernel-qcow2-linux-6a5d1db98ef1da5c632640133898aa42d6916c6c.tar.xz
kernel-qcow2-linux-6a5d1db98ef1da5c632640133898aa42d6916c6c.zip
drm/i915: Spin until breadcrumb threads are complete
When we need to reset the global seqno on wraparound, we have to wait until the current rbtrees are drained (or otherwise the next waiter will be out of sequence). The current mechanism to kick and spin until complete, may exit too early as it would break if the target thread was currently running. Instead, we must wake up the threads, but keep spinning until the trees have been deleted. In order to appease Tvrtko, busy spin rather than yield(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20161108143719.32215-1-chris@chris-wilson.co.uk Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_request.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_request.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
index 0b3b051a5683..5050464c5401 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.c
+++ b/drivers/gpu/drm/i915/i915_gem_request.c
@@ -241,9 +241,8 @@ static int i915_gem_init_global_seqno(struct drm_i915_private *i915, u32 seqno)
/* If the seqno wraps around, we need to clear the breadcrumb rbtree */
if (!i915_seqno_passed(seqno, atomic_read(&timeline->next_seqno))) {
- while (intel_kick_waiters(i915) || intel_kick_signalers(i915))
- yield();
- yield();
+ while (intel_breadcrumbs_busy(i915))
+ cond_resched(); /* spin until threads are complete */
}
atomic_set(&timeline->next_seqno, seqno);