aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Kuoppala <mika.kuoppala@linux.intel.com>2018-05-08 08:41:54 -0400
committerMika Kuoppala <mika.kuoppala@linux.intel.com>2018-05-11 08:52:21 -0400
commitca6acc25250a1dc101c5a541b4f58bcc1dd65de5 (patch)
tree5ea00e7451e98bc76727396ac843610d33d1d6b0
parent429204f1059909245d8f73b66aa729c6c2807cae (diff)
drm/i915/gtt: Trust the uncached store to flush wcb
Not all architectures guarantee that uncached read will flush the write combining buffer. So marking it explicitly is recommended [1]. However we know the architecture we are operating on and can avoid wmb as the UC store will flush the wcb [2]. Omit the wmb() before invalidate as redudant. v2: squash combining and removal (Chris) v3: remove obsolete comments about posting reads (Chris) References: http://yarchive.net/comp/linux/write_combining.html [1] References: http://download.intel.com/design/PentiumII/applnots/24442201.pdf [2] Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Matthew Auld <matthew.auld@intel.com> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20180508124154.14586-1-mika.kuoppala@linux.intel.com
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index c879bfd9294f..6eae9e1ed8be 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -110,7 +110,8 @@ i915_get_ggtt_vma_pages(struct i915_vma *vma);
110 110
111static void gen6_ggtt_invalidate(struct drm_i915_private *dev_priv) 111static void gen6_ggtt_invalidate(struct drm_i915_private *dev_priv)
112{ 112{
113 /* Note that as an uncached mmio write, this should flush the 113 /*
114 * Note that as an uncached mmio write, this will flush the
114 * WCB of the writes into the GGTT before it triggers the invalidate. 115 * WCB of the writes into the GGTT before it triggers the invalidate.
115 */ 116 */
116 I915_WRITE(GFX_FLSH_CNTL_GEN6, GFX_FLSH_CNTL_EN); 117 I915_WRITE(GFX_FLSH_CNTL_GEN6, GFX_FLSH_CNTL_EN);
@@ -2418,11 +2419,9 @@ static void gen8_ggtt_insert_entries(struct i915_address_space *vm,
2418 for_each_sgt_dma(addr, sgt_iter, vma->pages) 2419 for_each_sgt_dma(addr, sgt_iter, vma->pages)
2419 gen8_set_pte(gtt_entries++, pte_encode | addr); 2420 gen8_set_pte(gtt_entries++, pte_encode | addr);
2420 2421
2421 wmb(); 2422 /*
2422 2423 * We want to flush the TLBs only after we're certain all the PTE
2423 /* This next bit makes the above posting read even more important. We 2424 * updates have finished.
2424 * want to flush the TLBs only after we're certain all the PTE updates
2425 * have finished.
2426 */ 2425 */
2427 ggtt->invalidate(vm->i915); 2426 ggtt->invalidate(vm->i915);
2428} 2427}
@@ -2460,11 +2459,10 @@ static void gen6_ggtt_insert_entries(struct i915_address_space *vm,
2460 dma_addr_t addr; 2459 dma_addr_t addr;
2461 for_each_sgt_dma(addr, iter, vma->pages) 2460 for_each_sgt_dma(addr, iter, vma->pages)
2462 iowrite32(vm->pte_encode(addr, level, flags), &entries[i++]); 2461 iowrite32(vm->pte_encode(addr, level, flags), &entries[i++]);
2463 wmb();
2464 2462
2465 /* This next bit makes the above posting read even more important. We 2463 /*
2466 * want to flush the TLBs only after we're certain all the PTE updates 2464 * We want to flush the TLBs only after we're certain all the PTE
2467 * have finished. 2465 * updates have finished.
2468 */ 2466 */
2469 ggtt->invalidate(vm->i915); 2467 ggtt->invalidate(vm->i915);
2470} 2468}