提交 68a85703 编写于 作者: C Chris Wilson

drm/i915/gtt: Invalidate GGTT caches after writing the gen6 page directories

When we update the gen6 ppgtt page directories, we do so by writing the
new address into a reserved slot in the GGTT. It appears that when the
GPU reads that entry from the gsm, it uses its small cache and that we
need to invalidate that cache after writing. We don't see an issue
currently as we prefill the ppgtt page directories on creation; and only
create the single aliasing_ppgtt long before we start using the GGTT
(and so before the cache may have a conflicting entry).
Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180611171825.13678-1-chris@chris-wilson.co.uk
上级 467d3578
...@@ -1693,7 +1693,7 @@ static inline void gen6_write_pde(const struct i915_hw_ppgtt *ppgtt, ...@@ -1693,7 +1693,7 @@ static inline void gen6_write_pde(const struct i915_hw_ppgtt *ppgtt,
const struct i915_page_table *pt) const struct i915_page_table *pt)
{ {
/* Caller needs to make sure the write completes if necessary */ /* Caller needs to make sure the write completes if necessary */
writel_relaxed(GEN6_PDE_ADDR_ENCODE(px_dma(pt)) | GEN6_PDE_VALID, iowrite32(GEN6_PDE_ADDR_ENCODE(px_dma(pt)) | GEN6_PDE_VALID,
ppgtt->pd_addr + pde); ppgtt->pd_addr + pde);
} }
...@@ -1709,7 +1709,7 @@ static void gen6_write_page_range(struct i915_hw_ppgtt *ppgtt, ...@@ -1709,7 +1709,7 @@ static void gen6_write_page_range(struct i915_hw_ppgtt *ppgtt,
gen6_write_pde(ppgtt, pde, pt); gen6_write_pde(ppgtt, pde, pt);
mark_tlbs_dirty(ppgtt); mark_tlbs_dirty(ppgtt);
wmb(); gen6_ggtt_invalidate(ppgtt->vm.i915);
} }
static void gen8_ppgtt_enable(struct drm_i915_private *dev_priv) static void gen8_ppgtt_enable(struct drm_i915_private *dev_priv)
...@@ -1864,7 +1864,7 @@ static int gen6_alloc_va_range(struct i915_address_space *vm, ...@@ -1864,7 +1864,7 @@ static int gen6_alloc_va_range(struct i915_address_space *vm,
if (flush) { if (flush) {
mark_tlbs_dirty(ppgtt); mark_tlbs_dirty(ppgtt);
wmb(); gen6_ggtt_invalidate(ppgtt->vm.i915);
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册