Lines Matching refs:pdp
540 struct i915_page_directory_pointer *pdp) in __pdp_init() argument
545 pdp->page_directory = kmalloc_array(pdpes, sizeof(*pdp->page_directory), in __pdp_init()
547 if (unlikely(!pdp->page_directory)) in __pdp_init()
551 pdp->page_directory[i] = vm->scratch_pd; in __pdp_init()
556 static void __pdp_fini(struct i915_page_directory_pointer *pdp) in __pdp_fini() argument
558 kfree(pdp->page_directory); in __pdp_fini()
559 pdp->page_directory = NULL; in __pdp_fini()
570 struct i915_page_directory_pointer *pdp; in alloc_pdp() local
575 pdp = kzalloc(sizeof(*pdp), GFP_KERNEL); in alloc_pdp()
576 if (!pdp) in alloc_pdp()
579 ret = __pdp_init(vm, pdp); in alloc_pdp()
583 ret = setup_px(vm, pdp); in alloc_pdp()
587 return pdp; in alloc_pdp()
590 __pdp_fini(pdp); in alloc_pdp()
592 kfree(pdp); in alloc_pdp()
598 struct i915_page_directory_pointer *pdp) in free_pdp() argument
600 __pdp_fini(pdp); in free_pdp()
605 cleanup_px(vm, pdp); in free_pdp()
606 kfree(pdp); in free_pdp()
610 struct i915_page_directory_pointer *pdp) in gen8_initialize_pdp() argument
616 fill_px(vm, pdp, scratch_pdpe); in gen8_initialize_pdp()
753 struct i915_page_directory_pointer *pdp, in gen8_ppgtt_set_pdpe() argument
759 pdp->page_directory[pdpe] = pd; in gen8_ppgtt_set_pdpe()
763 vaddr = kmap_atomic_px(pdp); in gen8_ppgtt_set_pdpe()
772 struct i915_page_directory_pointer *pdp, in gen8_ppgtt_clear_pdp() argument
778 gen8_for_each_pdpe(pd, pdp, start, length, pdpe) { in gen8_ppgtt_clear_pdp()
784 gen8_ppgtt_set_pdpe(vm, pdp, vm->scratch_pd, pdpe); in gen8_ppgtt_clear_pdp()
785 GEM_BUG_ON(!pdp->used_pdpes); in gen8_ppgtt_clear_pdp()
786 pdp->used_pdpes--; in gen8_ppgtt_clear_pdp()
791 return !pdp->used_pdpes; in gen8_ppgtt_clear_pdp()
797 gen8_ppgtt_clear_pdp(vm, &i915_vm_to_ppgtt(vm)->pdp, start, length); in gen8_ppgtt_clear_3lvl()
801 struct i915_page_directory_pointer *pdp, in gen8_ppgtt_set_pml4e() argument
806 pml4->pdps[pml4e] = pdp; in gen8_ppgtt_set_pml4e()
809 vaddr[pml4e] = gen8_pml4e_encode(px_dma(pdp), I915_CACHE_LLC); in gen8_ppgtt_set_pml4e()
822 struct i915_page_directory_pointer *pdp; in gen8_ppgtt_clear_4lvl() local
827 gen8_for_each_pml4e(pdp, pml4, start, length, pml4e) { in gen8_ppgtt_clear_4lvl()
828 GEM_BUG_ON(pdp == vm->scratch_pdp); in gen8_ppgtt_clear_4lvl()
830 if (!gen8_ppgtt_clear_pdp(vm, pdp, start, length)) in gen8_ppgtt_clear_4lvl()
835 free_pdp(vm, pdp); in gen8_ppgtt_clear_4lvl()
867 struct i915_page_directory_pointer *pdp, in gen8_ppgtt_insert_pte_entries() argument
879 pd = pdp->page_directory[idx->pdpe]; in gen8_ppgtt_insert_pte_entries()
910 pd = pdp->page_directory[idx->pdpe]; in gen8_ppgtt_insert_pte_entries()
931 gen8_ppgtt_insert_pte_entries(ppgtt, &ppgtt->pdp, &iter, &idx, in gen8_ppgtt_insert_3lvl()
1019 I915_WRITE(vgtif_reg(pdp[0].lo), lower_32_bits(daddr)); in gen8_ppgtt_notify_vgt()
1020 I915_WRITE(vgtif_reg(pdp[0].hi), upper_32_bits(daddr)); in gen8_ppgtt_notify_vgt()
1028 I915_WRITE(vgtif_reg(pdp[i].lo), lower_32_bits(daddr)); in gen8_ppgtt_notify_vgt()
1029 I915_WRITE(vgtif_reg(pdp[i].hi), upper_32_bits(daddr)); in gen8_ppgtt_notify_vgt()
1051 struct i915_page_directory_pointer *pdp) in gen8_ppgtt_cleanup_3lvl() argument
1057 if (pdp->page_directory[i] == vm->scratch_pd) in gen8_ppgtt_cleanup_3lvl()
1060 gen8_free_page_tables(vm, pdp->page_directory[i]); in gen8_ppgtt_cleanup_3lvl()
1061 free_pd(vm, pdp->page_directory[i]); in gen8_ppgtt_cleanup_3lvl()
1064 free_pdp(vm, pdp); in gen8_ppgtt_cleanup_3lvl()
1092 gen8_ppgtt_cleanup_3lvl(&ppgtt->base, &ppgtt->pdp); in gen8_ppgtt_cleanup()
1128 struct i915_page_directory_pointer *pdp, in gen8_ppgtt_alloc_pdp() argument
1136 gen8_for_each_pdpe(pd, pdp, start, length, pdpe) { in gen8_ppgtt_alloc_pdp()
1143 gen8_ppgtt_set_pdpe(vm, pdp, pd, pdpe); in gen8_ppgtt_alloc_pdp()
1144 pdp->used_pdpes++; in gen8_ppgtt_alloc_pdp()
1145 GEM_BUG_ON(pdp->used_pdpes > i915_pdpes_per_pdp(vm)); in gen8_ppgtt_alloc_pdp()
1159 gen8_ppgtt_set_pdpe(vm, pdp, vm->scratch_pd, pdpe); in gen8_ppgtt_alloc_pdp()
1160 GEM_BUG_ON(!pdp->used_pdpes); in gen8_ppgtt_alloc_pdp()
1161 pdp->used_pdpes--; in gen8_ppgtt_alloc_pdp()
1165 gen8_ppgtt_clear_pdp(vm, pdp, from, start - from); in gen8_ppgtt_alloc_pdp()
1173 &i915_vm_to_ppgtt(vm)->pdp, start, length); in gen8_ppgtt_alloc_3lvl()
1181 struct i915_page_directory_pointer *pdp; in gen8_ppgtt_alloc_4lvl() local
1186 gen8_for_each_pml4e(pdp, pml4, start, length, pml4e) { in gen8_ppgtt_alloc_4lvl()
1188 pdp = alloc_pdp(vm); in gen8_ppgtt_alloc_4lvl()
1189 if (IS_ERR(pdp)) in gen8_ppgtt_alloc_4lvl()
1192 gen8_initialize_pdp(vm, pdp); in gen8_ppgtt_alloc_4lvl()
1193 gen8_ppgtt_set_pml4e(pml4, pdp, pml4e); in gen8_ppgtt_alloc_4lvl()
1196 ret = gen8_ppgtt_alloc_pdp(vm, pdp, start, length); in gen8_ppgtt_alloc_4lvl()
1204 if (!pdp->used_pdpes) { in gen8_ppgtt_alloc_4lvl()
1206 free_pdp(vm, pdp); in gen8_ppgtt_alloc_4lvl()
1214 struct i915_page_directory_pointer *pdp, in gen8_dump_pdp() argument
1223 gen8_for_each_pdpe(pd, pdp, start, length, pdpe) { in gen8_dump_pdp()
1229 if (pdp->page_directory[pdpe] == ppgtt->base.scratch_pd) in gen8_dump_pdp()
1278 struct i915_page_directory_pointer *pdp; in gen8_dump_ppgtt() local
1280 gen8_for_each_pml4e(pdp, pml4, start, length, pml4e) { in gen8_dump_ppgtt()
1285 gen8_dump_pdp(ppgtt, pdp, start, length, scratch_pte, m); in gen8_dump_ppgtt()
1288 gen8_dump_pdp(ppgtt, &ppgtt->pdp, start, length, scratch_pte, m); in gen8_dump_ppgtt()
1295 struct i915_page_directory_pointer *pdp = &ppgtt->pdp; in gen8_preallocate_top_level_pdp() local
1301 gen8_for_each_pdpe(pd, pdp, start, length, pdpe) { in gen8_preallocate_top_level_pdp()
1307 gen8_ppgtt_set_pdpe(vm, pdp, pd, pdpe); in gen8_preallocate_top_level_pdp()
1308 pdp->used_pdpes++; in gen8_preallocate_top_level_pdp()
1311 pdp->used_pdpes++; /* never remove */ in gen8_preallocate_top_level_pdp()
1316 gen8_for_each_pdpe(pd, pdp, from, start, pdpe) { in gen8_preallocate_top_level_pdp()
1317 gen8_ppgtt_set_pdpe(vm, pdp, vm->scratch_pd, pdpe); in gen8_preallocate_top_level_pdp()
1320 pdp->used_pdpes = 0; in gen8_preallocate_top_level_pdp()
1372 ret = __pdp_init(&ppgtt->base, &ppgtt->pdp); in gen8_ppgtt_init()
1379 __pdp_fini(&ppgtt->pdp); in gen8_ppgtt_init()