summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2012-04-26 16:03:05 -0700
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-05-03 11:18:23 +0200
commit3b88cc0dd72e82df65c634f19417158787d86bfe (patch)
tree1361bf4a795100fbb6020ce752481bef48fe397e /drivers/gpu
parent4146b08d767a702682bd28e2a21b062983fd937c (diff)
downloadlinux-3b88cc0dd72e82df65c634f19417158787d86bfe.tar.gz
linux-3b88cc0dd72e82df65c634f19417158787d86bfe.tar.bz2
linux-3b88cc0dd72e82df65c634f19417158787d86bfe.zip
drm/i915: use __wait_seqno for ring throttle
It turns out throttle had an almost identical bit of code to do the wait. Now we can call the new helper directly. This is just a bonus, and not needed for the overall series. v2: remove irq_get/put which is now in __wait_seqno (Ben) Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index c19a6214daf7..293f573803ab 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2981,25 +2981,7 @@ i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file)
if (seqno == 0)
return 0;
- ret = 0;
- if (!i915_seqno_passed(ring->get_seqno(ring), 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)) {
- ret = wait_event_interruptible(ring->irq_queue,
- i915_seqno_passed(ring->get_seqno(ring), seqno)
- || atomic_read(&dev_priv->mm.wedged));
- ring->irq_put(ring);
-
- if (ret == 0 && atomic_read(&dev_priv->mm.wedged))
- ret = -EIO;
- } else
- ret = -EBUSY;
- }
-
+ ret = __wait_seqno(ring, seqno, true);
if (ret == 0)
queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, 0);