drm/i915: Do the fallback non-IRQ wait in ring throttle, too.
[pandora-kernel.git] / drivers / gpu / drm / i915 / i915_gem.c
index 60ff1b6..3e2edc6 100644 (file)
@@ -2026,13 +2026,8 @@ i915_wait_request(struct intel_ring_buffer *ring,
         * to handle this, the waiter on a request often wants an associated
         * buffer to have made it to the inactive list, and we would need
         * a separate wait queue to handle that.
-        *
-        * To avoid a recursion with the ilk VT-d workaround (that calls
-        * gpu_idle when unbinding objects with interruptible==false) don't
-        * retire requests in that case (because it might call unbind if the
-        * active list holds the last reference to the object).
         */
-       if (ret == 0 && dev_priv->mm.interruptible)
+       if (ret == 0)
                i915_gem_retire_requests_ring(ring);
 
        return ret;
@@ -3089,10 +3084,13 @@ i915_gem_object_finish_gpu(struct drm_i915_gem_object *obj)
                        return ret;
        }
 
+       ret = i915_gem_object_wait_rendering(obj);
+       if (ret)
+               return ret;
+
        /* Ensure that we invalidate the GPU's caches and TLBs. */
        obj->base.read_domains &= ~I915_GEM_GPU_DOMAINS;
-
-       return i915_gem_object_wait_rendering(obj);
+       return 0;
 }
 
 /**
@@ -3314,6 +3312,10 @@ i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file)
 
                        if (ret == 0 && atomic_read(&dev_priv->mm.wedged))
                                ret = -EIO;
+               } else if (wait_for(i915_seqno_passed(ring->get_seqno(ring),
+                                                     seqno) ||
+                                   atomic_read(&dev_priv->mm.wedged), 3000)) {
+                       ret = -EBUSY;
                }
        }