From 50bce2bc625deb439dd61f504496dddd0cd4f572 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 May 2008 13:47:34 -0700 Subject: [intel-gem] Only update obj->write_domain if we're actually changing it. The problem was revealed where on 965, the display list vertex buffer would see: create -> (CPU, CPU) set_domain (CPU, CPU) -> (CPU, CPU) set_comain (CPU, 0) -> (CPU, 0) (no clflush occurred) execbuf (GPU, 0) -> (CPU+GPU, 0) (still no clflush) instead of: create -> (CPU, CPU) set_domain (CPU, CPU) -> (CPU, CPU) set_comain (CPU, 0) -> (CPU, CPU) execbuf (GPU, 0) -> (CPU+GPU, 0) (clflushed) --- linux-core/i915_gem.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linux-core/i915_gem.c b/linux-core/i915_gem.c index 7c826aeb..bcc15dd3 100644 --- a/linux-core/i915_gem.c +++ b/linux-core/i915_gem.c @@ -945,7 +945,8 @@ i915_gem_object_set_domain(struct drm_gem_object *obj, i915_gem_clflush_object(obj); } - obj->write_domain = write_domain; + if ((write_domain | flush_domains) != 0) + obj->write_domain = write_domain; obj->read_domains = read_domains; dev->invalidate_domains |= invalidate_domains; dev->flush_domains |= flush_domains; @@ -1225,7 +1226,8 @@ i915_gem_reloc_and_validate_object(struct drm_gem_object *obj, iounmap(reloc_page); #if WATCH_BUF - i915_gem_dump_object(obj, 128, __func__, ~0); + if (0) + i915_gem_dump_object(obj, 128, __func__, ~0); #endif return 0; } -- cgit v1.2.3