| From bb6729beb868d5d75aac9998fc3fa8e4f32aa337 Mon Sep 17 00:00:00 2001 |
| From: Chris Wilson <chris@chris-wilson.co.uk> |
| Date: Thu, 8 Aug 2013 14:41:06 +0100 |
| Subject: drm/i915: Allow the GPU to cache stolen memory |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| As a corollary to reviewing the interaction between LLC and our cache |
| domains, the GPU PTE bits are independent of the CPU PAT bits. As such |
| we can set the cache level on stolen memory based on how we wish the GPU |
| to cache accesses to it. So we are free to set the same default cache |
| levels as for normal bo, i.e. enable LLC cacheing by default where |
| appropriate. |
| |
| Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> |
| Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> |
| Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> |
| (cherry picked from commit d46f1c3f1372e3a72fab97c60480aa4a1084387f) |
| Signed-off-by: Darren Hart <dvhart@linux.intel.com> |
| --- |
| drivers/gpu/drm/i915/i915_gem_stolen.c | 5 ++--- |
| 1 file changed, 2 insertions(+), 3 deletions(-) |
| |
| diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c |
| index 8912f489f53a..8b03327f74b9 100644 |
| --- a/drivers/gpu/drm/i915/i915_gem_stolen.c |
| +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c |
| @@ -296,9 +296,8 @@ _i915_gem_object_create_stolen(struct drm_device *dev, |
| i915_gem_object_pin_pages(obj); |
| obj->stolen = stolen; |
| |
| - obj->base.write_domain = I915_GEM_DOMAIN_GTT; |
| - obj->base.read_domains = I915_GEM_DOMAIN_GTT; |
| - obj->cache_level = I915_CACHE_NONE; |
| + obj->base.read_domains = I915_GEM_DOMAIN_CPU | I915_GEM_DOMAIN_GTT; |
| + obj->cache_level = HAS_LLC(dev) ? I915_CACHE_LLC : I915_CACHE_NONE; |
| |
| return obj; |
| |
| -- |
| 1.8.5.rc3 |
| |