public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Handle sync_seqno correctly when seqno has wrapped.
@ 2012-11-13 13:51 Mika Kuoppala
  2012-11-13 14:15 ` Chris Wilson
  2012-11-13 16:39 ` Ben Widawsky
  0 siblings, 2 replies; 9+ messages in thread
From: Mika Kuoppala @ 2012-11-13 13:51 UTC (permalink / raw)
  To: intel-gfx

If seqno has wrapped, normal compare operation will give wrong results.
i915_seqno_passed can handle the wrap so use it instead.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index cdcf19d..35d5db8 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2138,7 +2138,7 @@ i915_gem_retire_requests_ring(struct intel_ring_buffer *ring)
 	seqno = ring->get_seqno(ring, true);
 
 	for (i = 0; i < ARRAY_SIZE(ring->sync_seqno); i++)
-		if (seqno >= ring->sync_seqno[i])
+		if (i915_seqno_passed(seqno, ring->sync_seqno[i]))
 			ring->sync_seqno[i] = 0;
 
 	while (!list_empty(&ring->request_list)) {
@@ -2376,7 +2376,7 @@ i915_gem_object_sync(struct drm_i915_gem_object *obj,
 	idx = intel_ring_sync_index(from, to);
 
 	seqno = obj->last_read_seqno;
-	if (seqno <= from->sync_seqno[idx])
+	if (i915_seqno_passed(from->sync_seqno[idx], seqno))
 		return 0;
 
 	ret = i915_gem_check_olr(obj->ring, seqno);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-11-29  8:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-13 13:51 [PATCH] drm/i915: Handle sync_seqno correctly when seqno has wrapped Mika Kuoppala
2012-11-13 14:15 ` Chris Wilson
2012-11-13 16:39 ` Ben Widawsky
2012-11-13 16:45   ` Daniel Vetter
2012-11-13 16:52     ` Ben Widawsky
2012-11-13 16:54     ` Chris Wilson
2012-11-19 10:55   ` Mika Kuoppala
2012-11-19 17:21     ` Ben Widawsky
2012-11-29  8:43       ` Mika Kuoppala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox