@@ -595,6 +595,12 @@ gen6_add_request(struct intel_ring_buffer *ring)
return 0;
}
+static inline u32 i915_gem_next_seqno(struct drm_device *dev)
+{
+ struct drm_i915_private *dev_priv = dev->dev_private;
+ return dev_priv->next_seqno;
+}
+
/**
* intel_ring_sync - sync the waiter to the signaller on seqno
*
@@ -628,7 +634,7 @@ gen6_ring_sync(struct intel_ring_buffer *waiter,
BUG_ON(!waiter->outstanding_lazy_request);
/* If seqno wrap happened, omit the wait with no-ops */
- if (likely(waiter->outstanding_lazy_request > seqno)) {
+ if (likely(i915_gem_next_seqno(waiter->dev) > seqno)) {
intel_ring_emit(waiter,
dw1 |
signaller->semaphore_register[waiter->id]);