drm/i915/ringbuffer: Disable the ringbuffer on cleanup.
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 29 Oct 2010 15:18:36 +0000 (16:18 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 29 Oct 2010 18:00:43 +0000 (19:00 +0100)
It should be idle on cleanup anyway...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/intel_ringbuffer.c

index 632a98e0ba5c5d62c80b8fc7aa423a1945e33fa1..0f1693981ee6728450b363cd71431866ac46a3d3 100644 (file)
@@ -651,9 +651,17 @@ err_hws:
 
 void intel_cleanup_ring_buffer(struct intel_ring_buffer *ring)
 {
+       struct drm_i915_private *dev_priv;
+       int ret;
+
        if (ring->gem_object == NULL)
                return;
 
+       /* Disable the ring buffer. The ring must be idle at this point */
+       dev_priv = ring->dev->dev_private;
+       ret = intel_wait_ring_buffer(ring, ring->size - 8);
+       I915_WRITE_CTL(ring, 0);
+
        drm_core_ioremapfree(&ring->map, ring->dev);
 
        i915_gem_object_unpin(ring->gem_object);