diff options
author | Owen Taylor <otaylor@redhat.com> | 2008-11-03 17:38:17 -0500 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2008-11-11 02:43:26 -0500 |
commit | 6a47baa6ce7e6fb5fed8d1fd0af36a96a4ad133f (patch) | |
tree | 7ad2e9ab0495856bc315bbf9640416ee1f70323b | |
parent | ad42ca8f4490de06462aee234ea0083cbd8b46aa (diff) |
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>
-rw-r--r-- | 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 b0ec73fa6a93..6b4a2bd20640 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, | |||
1455 | read_domains, write_domain); | 1455 | read_domains, write_domain); |
1456 | 1456 | ||
1457 | /* Wait on any GPU rendering to the object to be flushed. */ | 1457 | /* Wait on any GPU rendering to the object to be flushed. */ |
1458 | if (obj->write_domain & ~(I915_GEM_DOMAIN_CPU | I915_GEM_DOMAIN_GTT)) { | 1458 | ret = i915_gem_object_wait_rendering(obj); |
1459 | ret = i915_gem_object_wait_rendering(obj); | 1459 | if (ret) |
1460 | if (ret) | 1460 | return ret; |
1461 | return ret; | ||
1462 | } | ||
1463 | 1461 | ||
1464 | if (obj_priv->page_cpu_valid == NULL) { | 1462 | if (obj_priv->page_cpu_valid == NULL) { |
1465 | obj_priv->page_cpu_valid = drm_calloc(1, obj->size / PAGE_SIZE, | 1463 | obj_priv->page_cpu_valid = drm_calloc(1, obj->size / PAGE_SIZE, |