diff options
author | Mika Kuoppala <mika.kuoppala@linux.intel.com> | 2012-11-28 10:18:45 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-11-29 05:43:54 -0500 |
commit | 7b01e260a6cad9152eefb44ce64f3a2073af1e6b (patch) | |
tree | dcd6f9de12bf3e22c79561b5f1a7b9a7aa42f4e3 /drivers/gpu/drm | |
parent | df2b23d97919601218e9229ff517afea83fe5520 (diff) |
drm/i915: Set sync_seqno properly after seqno wrap
i915_gem_handle_seqno_wrap() will zero all sync_seqnos but as the
wrap can happen inside ring->sync_to(), pre wrap seqno was
carried over and overwrote the zeroed sync_seqno.
When wrap is handled, all outstanding requests will be retired and
objects moved to inactive queue, causing their last_read_seqno to be zero.
Use this to update the sync_seqno correctly.
RING_SYNC registers after wrap will contain pre wrap values which
are >= seqno. So injecting the semaphore wait into ring completes
immediately.
Original idea for using last_read_seqno from Chris Wilson.
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
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 | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 85a09482c2a9..4ef8b5714337 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2397,7 +2397,11 @@ i915_gem_object_sync(struct drm_i915_gem_object *obj, | |||
2397 | 2397 | ||
2398 | ret = to->sync_to(to, from, seqno); | 2398 | ret = to->sync_to(to, from, seqno); |
2399 | if (!ret) | 2399 | if (!ret) |
2400 | from->sync_seqno[idx] = seqno; | 2400 | /* We use last_read_seqno because sync_to() |
2401 | * might have just caused seqno wrap under | ||
2402 | * the radar. | ||
2403 | */ | ||
2404 | from->sync_seqno[idx] = obj->last_read_seqno; | ||
2401 | 2405 | ||
2402 | return ret; | 2406 | return ret; |
2403 | } | 2407 | } |