aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index c79c0b62ef60..f9c093c08d58 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2393,6 +2393,12 @@ i915_gem_object_flush_fence(struct drm_i915_gem_object *obj,
2393 obj->last_fenced_ring = NULL; 2393 obj->last_fenced_ring = NULL;
2394 } 2394 }
2395 2395
2396 /* Ensure that all CPU reads are completed before installing a fence
2397 * and all writes before removing the fence.
2398 */
2399 if (obj->base.read_domains & I915_GEM_DOMAIN_GTT)
2400 mb();
2401
2396 return 0; 2402 return 0;
2397} 2403}
2398 2404
@@ -2833,10 +2839,16 @@ i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj)
2833 if (obj->base.write_domain != I915_GEM_DOMAIN_GTT) 2839 if (obj->base.write_domain != I915_GEM_DOMAIN_GTT)
2834 return; 2840 return;
2835 2841
2836 /* No actual flushing is required for the GTT write domain. Writes 2842 /* No actual flushing is required for the GTT write domain. Writes
2837 * to it immediately go to main memory as far as we know, so there's 2843 * to it immediately go to main memory as far as we know, so there's
2838 * no chipset flush. It also doesn't land in render cache. 2844 * no chipset flush. It also doesn't land in render cache.
2845 *
2846 * However, we do have to enforce the order so that all writes through
2847 * the GTT land before any writes to the device, such as updates to
2848 * the GATT itself.
2839 */ 2849 */
2850 wmb();
2851
2840 i915_gem_release_mmap(obj); 2852 i915_gem_release_mmap(obj);
2841 2853
2842 old_write_domain = obj->base.write_domain; 2854 old_write_domain = obj->base.write_domain;