aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2013-02-13 14:56:05 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-02-19 18:21:43 -0500
commit769ce4643b775496166d09c227b070cc38f9e205 (patch)
tree4169bb20e669a36af5c51f80168551aa8da7d669 /drivers/gpu/drm/i915/i915_gem.c
parent10d8373064762b21e16e73bc7dfde49d68f4e31f (diff)
drm/i915: don't clflush gem objects in stolen memory
As explained by Chris Wilson gem objects in stolen memory are always coherent with the GPU so we don't need to ever flush the CPU caches for these. This fixes a breakage - at least with the compact sg patches applied - during the resume/restore gtt mappings path, when we tried to clflush an FB object in stolen memory, but since stolen objects don't have backing pages we passed an invalid page pointer to drm_clflush_page(). Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d8618f32557e..a3678018af36 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3021,6 +3021,13 @@ i915_gem_clflush_object(struct drm_i915_gem_object *obj)
3021 if (obj->pages == NULL) 3021 if (obj->pages == NULL)
3022 return; 3022 return;
3023 3023
3024 /*
3025 * Stolen memory is always coherent with the GPU as it is explicitly
3026 * marked as wc by the system, or the system is cache-coherent.
3027 */
3028 if (obj->stolen)
3029 return;
3030
3024 /* If the GPU is snooping the contents of the CPU cache, 3031 /* If the GPU is snooping the contents of the CPU cache,
3025 * we do not need to manually clear the CPU cache lines. However, 3032 * we do not need to manually clear the CPU cache lines. However,
3026 * the caches are only snooped when the render cache is 3033 * the caches are only snooped when the render cache is