Lines Matching refs:ppgtt

58 static void gen8_ppgtt_notify_vgt(struct i915_ppgtt *ppgtt, bool create)  in gen8_ppgtt_notify_vgt()  argument
60 struct drm_i915_private *i915 = ppgtt->vm.i915; in gen8_ppgtt_notify_vgt()
61 struct intel_uncore *uncore = ppgtt->vm.gt->uncore; in gen8_ppgtt_notify_vgt()
66 atomic_inc(px_used(ppgtt->pd)); /* never remove */ in gen8_ppgtt_notify_vgt()
68 atomic_dec(px_used(ppgtt->pd)); in gen8_ppgtt_notify_vgt()
72 if (i915_vm_is_4lvl(&ppgtt->vm)) { in gen8_ppgtt_notify_vgt()
73 const u64 daddr = px_dma(ppgtt->pd); in gen8_ppgtt_notify_vgt()
85 const u64 daddr = i915_page_dir_dma_addr(ppgtt, i); in gen8_ppgtt_notify_vgt()
160 struct i915_ppgtt * const ppgtt = i915_vm_to_ppgtt(vm); in gen8_pdp_for_page_index() local
163 return ppgtt->pd; in gen8_pdp_for_page_index()
165 return i915_pd_entry(ppgtt->pd, gen8_pd_index(idx, vm->top)); in gen8_pdp_for_page_index()
194 struct i915_ppgtt *ppgtt = i915_vm_to_ppgtt(vm); in gen8_ppgtt_cleanup() local
197 gen8_ppgtt_notify_vgt(ppgtt, false); in gen8_ppgtt_cleanup()
199 __gen8_ppgtt_cleanup(vm, ppgtt->pd, gen8_pd_top_count(vm), vm->top); in gen8_ppgtt_cleanup()
410 gen8_ppgtt_insert_pte(struct i915_ppgtt *ppgtt, in gen8_ppgtt_insert_pte() argument
585 struct i915_ppgtt * const ppgtt = i915_vm_to_ppgtt(vm); in gen8_ppgtt_insert() local
597 idx = gen8_ppgtt_insert_pte(ppgtt, pdp, &iter, idx, in gen8_ppgtt_insert()
684 static int gen8_preallocate_top_level_pdp(struct i915_ppgtt *ppgtt) in gen8_preallocate_top_level_pdp() argument
686 struct i915_address_space *vm = &ppgtt->vm; in gen8_preallocate_top_level_pdp()
687 struct i915_page_directory *pd = ppgtt->pd; in gen8_preallocate_top_level_pdp()
759 struct i915_ppgtt *ppgtt; in gen8_ppgtt_create() local
762 ppgtt = kzalloc(sizeof(*ppgtt), GFP_KERNEL); in gen8_ppgtt_create()
763 if (!ppgtt) in gen8_ppgtt_create()
766 ppgtt_init(ppgtt, gt, lmem_pt_obj_flags); in gen8_ppgtt_create()
767 ppgtt->vm.top = i915_vm_is_4lvl(&ppgtt->vm) ? 3 : 2; in gen8_ppgtt_create()
768 ppgtt->vm.pd_shift = ilog2(SZ_4K * SZ_4K / sizeof(gen8_pte_t)); in gen8_ppgtt_create()
778 ppgtt->vm.has_read_only = !IS_GRAPHICS_VER(gt->i915, 11, 12); in gen8_ppgtt_create()
781 ppgtt->vm.alloc_pt_dma = alloc_pt_lmem; in gen8_ppgtt_create()
783 ppgtt->vm.alloc_pt_dma = alloc_pt_dma; in gen8_ppgtt_create()
785 err = gen8_init_scratch(&ppgtt->vm); in gen8_ppgtt_create()
789 ppgtt->pd = gen8_alloc_top_pd(&ppgtt->vm); in gen8_ppgtt_create()
790 if (IS_ERR(ppgtt->pd)) { in gen8_ppgtt_create()
791 err = PTR_ERR(ppgtt->pd); in gen8_ppgtt_create()
795 if (!i915_vm_is_4lvl(&ppgtt->vm)) { in gen8_ppgtt_create()
796 err = gen8_preallocate_top_level_pdp(ppgtt); in gen8_ppgtt_create()
801 ppgtt->vm.bind_async_flags = I915_VMA_LOCAL_BIND; in gen8_ppgtt_create()
802 ppgtt->vm.insert_entries = gen8_ppgtt_insert; in gen8_ppgtt_create()
803 ppgtt->vm.insert_page = gen8_ppgtt_insert_entry; in gen8_ppgtt_create()
804 ppgtt->vm.allocate_va_range = gen8_ppgtt_alloc; in gen8_ppgtt_create()
805 ppgtt->vm.clear_range = gen8_ppgtt_clear; in gen8_ppgtt_create()
806 ppgtt->vm.foreach = gen8_ppgtt_foreach; in gen8_ppgtt_create()
808 ppgtt->vm.pte_encode = gen8_pte_encode; in gen8_ppgtt_create()
811 gen8_ppgtt_notify_vgt(ppgtt, true); in gen8_ppgtt_create()
813 ppgtt->vm.cleanup = gen8_ppgtt_cleanup; in gen8_ppgtt_create()
815 return ppgtt; in gen8_ppgtt_create()
818 __gen8_ppgtt_cleanup(&ppgtt->vm, ppgtt->pd, in gen8_ppgtt_create()
819 gen8_pd_top_count(&ppgtt->vm), ppgtt->vm.top); in gen8_ppgtt_create()
821 free_scratch(&ppgtt->vm); in gen8_ppgtt_create()
823 kfree(ppgtt); in gen8_ppgtt_create()