[PATCH 76/77] mark-ppgtt
Chris Wilson
chris at chris-wilson.co.uk
Sun Jan 1 10:30:09 UTC 2017
---
drivers/gpu/drm/i915/i915_gem_gtt.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index f46e6cec1e26..62da8f58cb56 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -158,6 +158,16 @@ int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv,
return has_aliasing_ppgtt ? 1 : 0;
}
+/* PDE TLBs are a pain to invalidate on GEN8+. When we modify
+ * the page table structures, we mark them dirty so that
+ * context switching/execlist queuing code takes extra steps
+ * to ensure that tlbs are flushed.
+ */
+static void mark_tlbs_dirty(struct i915_hw_ppgtt *ppgtt)
+{
+ ppgtt->pd_dirty_rings = INTEL_INFO(ppgtt->base.i915)->ring_mask;
+}
+
static int ppgtt_bind_vma(struct i915_vma *vma,
enum i915_cache_level cache_level,
u32 unused)
@@ -172,6 +182,7 @@ static int ppgtt_bind_vma(struct i915_vma *vma,
vma->vm->insert_entries(vma->vm, vma->pages, vma->node.start,
cache_level, pte_flags);
+ mark_tlbs_dirty(i915_vm_to_ppgtt(vma->vm));
return 0;
}
@@ -645,16 +656,6 @@ static int gen8_48b_mm_switch(struct i915_hw_ppgtt *ppgtt,
return gen8_write_pdp(req, 0, px_dma(&ppgtt->pml4));
}
-/* PDE TLBs are a pain to invalidate on GEN8+. When we modify
- * the page table structures, we mark them dirty so that
- * context switching/execlist queuing code takes extra steps
- * to ensure that tlbs are flushed.
- */
-static void mark_tlbs_dirty(struct i915_hw_ppgtt *ppgtt)
-{
- ppgtt->pd_dirty_rings = INTEL_INFO(ppgtt->base.i915)->ring_mask;
-}
-
/* Removes entries from a single page table, releasing it if it's empty.
* Caller can use the return value to update higher-level entries.
*/
@@ -1029,7 +1030,6 @@ static int gen8_ppgtt_alloc_pdp(struct i915_address_space *vm,
struct i915_page_directory_pointer *pdp,
u64 start, u64 length)
{
- struct i915_hw_ppgtt *ppgtt = i915_vm_to_ppgtt(vm);
struct i915_page_directory *pd;
u64 from = start;
u32 pdpe;
@@ -1052,7 +1052,6 @@ static int gen8_ppgtt_alloc_pdp(struct i915_address_space *vm,
goto unwind;
}
- mark_tlbs_dirty(ppgtt);
return 0;
unwind:
@@ -1617,7 +1616,6 @@ static int gen6_alloc_va_range(struct i915_address_space *vm,
gen6_pte_count(start, length));
}
- mark_tlbs_dirty(ppgtt);
return 0;
unwind_out:
--
2.11.0
More information about the Intel-gfx-trybot
mailing list