summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJonathan Gray <jsg@jsg.id.au>2013-03-08 16:11:22 +1100
committerJonathan Gray <jsg@jsg.id.au>2013-03-08 16:11:22 +1100
commitbd9462fd70a363f340e14541b9c4d9ca732b3f99 (patch)
treedd217ebd40a51a0d1ac46afdc040a53c21ff79f7 /sys/dev/pci
parent4abc28331625d5ba9ca074ba6fda01899256ef29 (diff)
use i915_gem_check_olr in a few more places
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/i915_gem.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/sys/dev/pci/drm/i915_gem.c b/sys/dev/pci/drm/i915_gem.c
index 3ff807421ee..4936a2275eb 100644
--- a/sys/dev/pci/drm/i915_gem.c
+++ b/sys/dev/pci/drm/i915_gem.c
@@ -445,11 +445,9 @@ i915_wait_seqno(struct intel_ring_buffer *ring, uint32_t seqno)
if (dev_priv->mm.wedged)
return (EIO);
- if (seqno == ring->outstanding_lazy_request) {
- ret = i915_add_request(ring, NULL, &seqno);
- if (ret)
- return (ret);
- }
+ ret = i915_gem_check_olr(ring, seqno);
+ if (ret)
+ return ret;
mtx_enter(&dev_priv->irq_lock);
if (!i915_seqno_passed(ring->get_seqno(ring, true), seqno)) {
@@ -1306,16 +1304,19 @@ i915_gem_object_sync(struct drm_i915_gem_object *obj,
if (seqno <= from->sync_seqno[idx])
return 0;
- if (seqno == from->outstanding_lazy_request) {
- ret = i915_add_request(from, NULL, &seqno);
- if (ret) {
- return ret;
- }
- }
+ ret = i915_gem_check_olr(obj->ring, seqno);
+ if (ret)
+ return ret;
- from->sync_seqno[idx] = seqno;
+ ret = to->sync_to(to, from, seqno);
+ if (!ret)
+ /* We use last_read_seqno because sync_to()
+ * might have just caused seqno wrap under
+ * the radar.
+ */
+ from->sync_seqno[idx] = obj->last_read_seqno;
- return to->sync_to(to, from, seqno);
+ return ret;
}
void