i915: Don't attempt to short-circuit object_wait_rendering by checking domains.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Tuesday, November 11, 2008 - 11:00 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6a47ba...
Commit:     6a47baa6ce7e6fb5fed8d1fd0af36a96a4ad133f
Parent:     ad42ca8f4490de06462aee234ea0083cbd8b46aa
Author:     Owen Taylor <otaylor@redhat.com>
AuthorDate: Mon Nov 3 14:38:17 2008 -0800
Committer:  Dave Airlie <airlied@linux.ie>
CommitDate: Tue Nov 11 17:43:26 2008 +1000

    i915: Don't attempt to short-circuit object_wait_rendering by checking domains.
    
    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 |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index b0ec73f..6b4a2bd 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -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,
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
i915: Don't attempt to short-circuit object_wait_rendering ..., Linux Kernel Mailing ..., (Tue Nov 11, 11:00 am)