aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_gtt.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-08 09:41:10 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-22 07:31:38 -0400
commit651d794fae9b79237aae1c97f8a9d9f3817bd31d (patch)
treea95018d3d8c8575f88ebc99af604564f90817927 /drivers/gpu/drm/i915/i915_gem_gtt.c
parentea04cb31d506ac3f4fc3cefb1c50eb4f35ab37fd (diff)
drm/i915: Use Write-Through cacheing for the display plane on Iris
Haswell GT3e has the unique feature of supporting Write-Through cacheing of objects within the eLLC/LLC. The purpose of this is to enable the display plane to remain coherent whilst objects lie resident in the eLLC/LLC - so that we, in theory, get the best of both worlds, perfect display and fast access. However, we still need to be careful as the CPU does not see the WT when accessing the cache. In particular, this means that we need to flush the cache lines after writing to an object through the CPU, and on transitioning from a cached state to WT. v2: Actually do the clflush on transition to WT, nagging by Ville. v3: Flush the CPU cache after writes into WT objects. v4: Rease onto LLC updates and report WT as "uncached" for get_cache_level_ioctl to remain symmetric with set_cache_level_ioctl. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_gtt.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index c9420c280cf0..212f6d8c35ec 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -55,6 +55,7 @@
55#define HSW_WB_LLC_AGE3 HSW_CACHEABILITY_CONTROL(0x2) 55#define HSW_WB_LLC_AGE3 HSW_CACHEABILITY_CONTROL(0x2)
56#define HSW_WB_LLC_AGE0 HSW_CACHEABILITY_CONTROL(0x3) 56#define HSW_WB_LLC_AGE0 HSW_CACHEABILITY_CONTROL(0x3)
57#define HSW_WB_ELLC_LLC_AGE0 HSW_CACHEABILITY_CONTROL(0xb) 57#define HSW_WB_ELLC_LLC_AGE0 HSW_CACHEABILITY_CONTROL(0xb)
58#define HSW_WT_ELLC_LLC_AGE0 HSW_CACHEABILITY_CONTROL(0x6)
58 59
59static gen6_gtt_pte_t snb_pte_encode(dma_addr_t addr, 60static gen6_gtt_pte_t snb_pte_encode(dma_addr_t addr,
60 enum i915_cache_level level) 61 enum i915_cache_level level)
@@ -138,8 +139,16 @@ static gen6_gtt_pte_t iris_pte_encode(dma_addr_t addr,
138 gen6_gtt_pte_t pte = GEN6_PTE_VALID; 139 gen6_gtt_pte_t pte = GEN6_PTE_VALID;
139 pte |= HSW_PTE_ADDR_ENCODE(addr); 140 pte |= HSW_PTE_ADDR_ENCODE(addr);
140 141
141 if (level != I915_CACHE_NONE) 142 switch (level) {
143 case I915_CACHE_NONE:
144 break;
145 case I915_CACHE_WT:
146 pte |= HSW_WT_ELLC_LLC_AGE0;
147 break;
148 default:
142 pte |= HSW_WB_ELLC_LLC_AGE0; 149 pte |= HSW_WB_ELLC_LLC_AGE0;
150 break;
151 }
143 152
144 return pte; 153 return pte;
145} 154}