Commit 97c809fd authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter

drm/i915: Only apply the mb() when flushing the GTT domain during a finish

Now that we seem to have brought order to the GTT barriers, the last one
to review is the terminal barrier before we unbind the buffer from the
GTT. This needs to only be performed if the buffer still resides in the
GTT domain, and so we can skip some needless barriers otherwise.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent d0a57789
...@@ -2407,15 +2407,15 @@ static void i915_gem_object_finish_gtt(struct drm_i915_gem_object *obj) ...@@ -2407,15 +2407,15 @@ static void i915_gem_object_finish_gtt(struct drm_i915_gem_object *obj)
{ {
u32 old_write_domain, old_read_domains; u32 old_write_domain, old_read_domains;
/* Act a barrier for all accesses through the GTT */
mb();
/* Force a pagefault for domain tracking on next user access */ /* Force a pagefault for domain tracking on next user access */
i915_gem_release_mmap(obj); i915_gem_release_mmap(obj);
if ((obj->base.read_domains & I915_GEM_DOMAIN_GTT) == 0) if ((obj->base.read_domains & I915_GEM_DOMAIN_GTT) == 0)
return; return;
/* Wait for any direct GTT access to complete */
mb();
old_read_domains = obj->base.read_domains; old_read_domains = obj->base.read_domains;
old_write_domain = obj->base.write_domain; old_write_domain = obj->base.write_domain;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment