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.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 264bec8f1f1d..bf32527fc928 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2878,6 +2878,17 @@ i915_gem_clflush_object(struct drm_i915_gem_object *obj)
2878 if (obj->pages == NULL) 2878 if (obj->pages == NULL)
2879 return; 2879 return;
2880 2880
2881 /* If the GPU is snooping the contents of the CPU cache,
2882 * we do not need to manually clear the CPU cache lines. However,
2883 * the caches are only snooped when the render cache is
2884 * flushed/invalidated. As we always have to emit invalidations
2885 * and flushes when moving into and out of the RENDER domain, correct
2886 * snooping behaviour occurs naturally as the result of our domain
2887 * tracking.
2888 */
2889 if (obj->cache_level != I915_CACHE_NONE)
2890 return;
2891
2881 trace_i915_gem_object_clflush(obj); 2892 trace_i915_gem_object_clflush(obj);
2882 2893
2883 drm_clflush_pages(obj->pages, obj->base.size / PAGE_SIZE); 2894 drm_clflush_pages(obj->pages, obj->base.size / PAGE_SIZE);