]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
drm/i915: Force the domain to CPU on unbinding whilst wedged.
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 30 Sep 2010 14:08:57 +0000 (15:08 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 1 Oct 2010 13:45:21 +0000 (14:45 +0100)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30083
Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_gem.c

index 16c4b7b9602c5a31d138385f969983a598de8309..c033c5a2e9fc9bc78c20c68737378a19607a99b5 100644 (file)
@@ -2158,6 +2158,10 @@ i915_gem_object_unbind(struct drm_gem_object *obj)
         * should be safe and we need to cleanup or else we might
         * cause memory corruption through use-after-free.
         */
+       if (ret) {
+               i915_gem_clflush_object(obj);
+               obj->read_domains = obj->write_domain = I915_GEM_DOMAIN_CPU;
+       }
 
        /* release the fence reg _after_ flushing */
        if (obj_priv->fence_reg != I915_FENCE_REG_NONE)