summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@jsg.id.au>2013-03-11 15:31:50 +1100
committerJonathan Gray <jsg@jsg.id.au>2013-03-11 15:31:50 +1100
commit1b3bd3341ef044fc7464104ac41f5c0ba245ffb5 (patch)
treefc88cc9addf01b89b6f524302ff2cafc13d4283d /sys
parent8a31e40677c4911deee514ea3d47b1a5f582e3f8 (diff)
move i915_gem_ring_throttle closer to 3.8.2
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/i915_gem.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/sys/dev/pci/drm/i915_gem.c b/sys/dev/pci/drm/i915_gem.c
index 97508030b19..193fcff2837 100644
--- a/sys/dev/pci/drm/i915_gem.c
+++ b/sys/dev/pci/drm/i915_gem.c
@@ -2371,7 +2371,7 @@ i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file)
struct drm_i915_gem_request *request;
struct intel_ring_buffer *ring = NULL;
u32 seqno = 0;
- int ret, retries;
+ int ret;
if (atomic_read(&dev_priv->mm.wedged))
return EIO;
@@ -2389,36 +2389,9 @@ i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file)
if (seqno == 0)
return 0;
- ret = 0;
- mtx_enter(&dev_priv->irq_lock);
- if (!i915_seqno_passed(ring->get_seqno(ring, false), seqno)) {
- /* And wait for the seqno passing without holding any locks and
- * causing extra latency for others. This is safe as the irq
- * generation is designed to be run atomically and so is
- * lockless.
- */
- if (ring->irq_get(ring)) {
- while (ret == 0 &&
- !(i915_seqno_passed(ring->get_seqno(ring, false), seqno) ||
- atomic_read(&dev_priv->mm.wedged)))
- ret = msleep(ring, &dev_priv->irq_lock, PCATCH,
- "915thr", 0);
- ring->irq_put(ring);
- } else {
- for (retries = 300; retries > 0; retries--) {
- if (i915_seqno_passed(ring->get_seqno(ring, false), seqno) ||
- atomic_read(&dev_priv->mm.wedged))
- break;
- DELAY(1000);
- }
- if (retries == 0)
- ret = EBUSY;
- }
- }
- mtx_leave(&dev_priv->irq_lock);
-
+ ret = __wait_seqno(ring, seqno, true, NULL);
if (ret == 0)
- inteldrm_timeout(dev_priv);
+ timeout_add_sec(&dev_priv->mm.retire_timer, 0);
return ret;
}