i915: Don't attempt to short-circuit object_wait_rendering by checking domains.
authorOwen Taylor <otaylor@redhat.com>
Mon, 3 Nov 2008 22:38:17 +0000 (14:38 -0800)
committerDave Airlie <airlied@linux.ie>
Tue, 11 Nov 2008 07:43:26 +0000 (17:43 +1000)
This could return early when reading after writing a buffer, if somebody
had already put it on the flushing list (write domains are 0, but still
active), leading to glReadPixels failure.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
drivers/gpu/drm/i915/i915_gem.c

index b0ec73fa6a9348c329b0fd8715e86848db4b4b84..6b4a2bd20640598f1e5407dc095ef3a9bed0d6b7 100644 (file)
@@ -1455,11 +1455,9 @@ i915_gem_object_set_domain_range(struct drm_gem_object *obj,
                                                  read_domains, write_domain);
 
        /* Wait on any GPU rendering to the object to be flushed. */
-       if (obj->write_domain & ~(I915_GEM_DOMAIN_CPU | I915_GEM_DOMAIN_GTT)) {
-               ret = i915_gem_object_wait_rendering(obj);
-               if (ret)
-                       return ret;
-       }
+       ret = i915_gem_object_wait_rendering(obj);
+       if (ret)
+               return ret;
 
        if (obj_priv->page_cpu_valid == NULL) {
                obj_priv->page_cpu_valid = drm_calloc(1, obj->size / PAGE_SIZE,