diff options
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 02ef50d512d..0f50574076b 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2067,8 +2067,14 @@ i915_gem_object_set_to_gpu_domain(struct drm_gem_object *obj) | |||
2067 | i915_gem_clflush_object(obj); | 2067 | i915_gem_clflush_object(obj); |
2068 | } | 2068 | } |
2069 | 2069 | ||
2070 | if ((obj->pending_write_domain | flush_domains) != 0) | 2070 | /* The actual obj->write_domain will be updated with |
2071 | obj->write_domain = obj->pending_write_domain; | 2071 | * pending_write_domain after we emit the accumulated flush for all |
2072 | * of our domain changes in execbuffers (which clears objects' | ||
2073 | * write_domains). So if we have a current write domain that we | ||
2074 | * aren't changing, set pending_write_domain to that. | ||
2075 | */ | ||
2076 | if (flush_domains == 0 && obj->pending_write_domain == 0) | ||
2077 | obj->pending_write_domain = obj->write_domain; | ||
2072 | obj->read_domains = obj->pending_read_domains; | 2078 | obj->read_domains = obj->pending_read_domains; |
2073 | 2079 | ||
2074 | dev->invalidate_domains |= invalidate_domains; | 2080 | dev->invalidate_domains |= invalidate_domains; |
@@ -2598,6 +2604,12 @@ i915_gem_execbuffer(struct drm_device *dev, void *data, | |||
2598 | (void)i915_add_request(dev, dev->flush_domains); | 2604 | (void)i915_add_request(dev, dev->flush_domains); |
2599 | } | 2605 | } |
2600 | 2606 | ||
2607 | for (i = 0; i < args->buffer_count; i++) { | ||
2608 | struct drm_gem_object *obj = object_list[i]; | ||
2609 | |||
2610 | obj->write_domain = obj->pending_write_domain; | ||
2611 | } | ||
2612 | |||
2601 | i915_verify_inactive(dev, __FILE__, __LINE__); | 2613 | i915_verify_inactive(dev, __FILE__, __LINE__); |
2602 | 2614 | ||
2603 | #if WATCH_COHERENCY | 2615 | #if WATCH_COHERENCY |