Skip to content

Commit

Permalink
drm/i915: Do not clflush snooped objects
Browse files Browse the repository at this point in the history
Rely on the GPU snooping into the CPU cache for appropriately bound
objects on MI_FLUSH. Or perhaps one day we will have a cache-coherent
CPU/GPU package...

Signed-off-by: Chris Wilson <[email protected]>
Signed-off-by: Eric Anholt <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Signed-off-by: Keith Packard <[email protected]>
  • Loading branch information
ickle authored and keith-packard committed May 10, 2011
1 parent 93dfb40 commit 9c23f7f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2878,6 +2878,17 @@ i915_gem_clflush_object(struct drm_i915_gem_object *obj)
if (obj->pages == NULL)
return;

/* If the GPU is snooping the contents of the CPU cache,
* we do not need to manually clear the CPU cache lines. However,
* the caches are only snooped when the render cache is
* flushed/invalidated. As we always have to emit invalidations
* and flushes when moving into and out of the RENDER domain, correct
* snooping behaviour occurs naturally as the result of our domain
* tracking.
*/
if (obj->cache_level != I915_CACHE_NONE)
return;

trace_i915_gem_object_clflush(obj);

drm_clflush_pages(obj->pages, obj->base.size / PAGE_SIZE);
Expand Down

0 comments on commit 9c23f7f

Please sign in to comment.