aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-11-27 11:22:54 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-11-29 05:43:53 -0500
commit3e9605018ab3e333d51cc90fccfde2031886763b (patch)
tree101b6600bbe9977dc0f9d296329d03158eba1075 /drivers/gpu/drm/i915/i915_gem.c
parentb662a0663230853fccdfceeda5db031f5d4b657c (diff)
drm/i915: Rearrange code to only have a single method for waiting upon the ring
Replace the wait for the ring to be clear with the more common wait for the ring to be idle. The principle advantage is one less exported intel_ring_wait function, and the removal of a hardcoded value. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index e594435eec9d..85a09482c2a9 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2480,29 +2480,6 @@ i915_gem_object_unbind(struct drm_i915_gem_object *obj)
2480 return 0; 2480 return 0;
2481} 2481}
2482 2482
2483static int i915_ring_idle(struct intel_ring_buffer *ring)
2484{
2485 u32 seqno;
2486 int ret;
2487
2488 /* We need to add any requests required to flush the objects and ring */
2489 if (ring->outstanding_lazy_request) {
2490 ret = i915_add_request(ring, NULL, NULL);
2491 if (ret)
2492 return ret;
2493 }
2494
2495 /* Wait upon the last request to be completed */
2496 if (list_empty(&ring->request_list))
2497 return 0;
2498
2499 seqno = list_entry(ring->request_list.prev,
2500 struct drm_i915_gem_request,
2501 list)->seqno;
2502
2503 return i915_wait_seqno(ring, seqno);
2504}
2505
2506int i915_gpu_idle(struct drm_device *dev) 2483int i915_gpu_idle(struct drm_device *dev)
2507{ 2484{
2508 drm_i915_private_t *dev_priv = dev->dev_private; 2485 drm_i915_private_t *dev_priv = dev->dev_private;
@@ -2515,7 +2492,7 @@ int i915_gpu_idle(struct drm_device *dev)
2515 if (ret) 2492 if (ret)
2516 return ret; 2493 return ret;
2517 2494
2518 ret = i915_ring_idle(ring); 2495 ret = intel_ring_idle(ring);
2519 if (ret) 2496 if (ret)
2520 return ret; 2497 return ret;
2521 } 2498 }