Lines Matching full:pd

100 	struct xe_lmtt_pt *pd;  in lmtt_init_pd()  local
102 lmtt_assert(lmtt, !lmtt->pd); in lmtt_init_pd()
105 pd = lmtt_pt_alloc(lmtt, lmtt->ops->lmtt_root_pd_level()); in lmtt_init_pd()
106 if (IS_ERR(pd)) in lmtt_init_pd()
107 return PTR_ERR(pd); in lmtt_init_pd()
109 lmtt->pd = pd; in lmtt_init_pd()
115 struct xe_lmtt_pt *pd = lmtt->pd; in lmtt_fini_pd() local
116 unsigned int num_entries = lmtt->ops->lmtt_pte_num(pd->level); in lmtt_fini_pd()
121 lmtt_assert(lmtt, !pd->entries[n]); in lmtt_fini_pd()
123 lmtt->pd = NULL; in lmtt_fini_pd()
124 lmtt_pt_free(pd); in lmtt_fini_pd()
131 lmtt_assert(lmtt, !(!!lmtt->ops ^ !!lmtt->pd)); in fini_lmtt()
133 if (!lmtt->pd) in fini_lmtt()
190 dma_addr_t offset = xe_bo_main_addr(lmtt->pd->bo, XE_PAGE_SIZE); in lmtt_setup_dir_ptr()
193 lmtt_assert(lmtt, xe_bo_is_vram(lmtt->pd->bo)); in lmtt_setup_dir_ptr()
213 if (!lmtt->pd) in xe_lmtt_init_hw()
239 static void lmtt_destroy_pt(struct xe_lmtt *lmtt, struct xe_lmtt_pt *pd) in lmtt_destroy_pt() argument
241 unsigned int num_entries = pd->level ? lmtt->ops->lmtt_pte_num(pd->level) : 0; in lmtt_destroy_pt()
246 pt = pd->entries[i]; in lmtt_destroy_pt()
247 pd->entries[i] = NULL; in lmtt_destroy_pt()
254 lmtt_pt_free(pd); in lmtt_destroy_pt()
259 struct xe_lmtt_pt *pd = lmtt->pd; in lmtt_drop_pages() local
262 pt = pd->entries[vfid]; in lmtt_drop_pages()
263 pd->entries[vfid] = NULL; in lmtt_drop_pages()
267 lmtt_write_pte(lmtt, pd, LMTT_PTE_INVALID, vfid); in lmtt_drop_pages()
269 lmtt_assert(lmtt, pd->level > 0); in lmtt_drop_pages()
270 lmtt_assert(lmtt, pt->level == pd->level - 1); in lmtt_drop_pages()
274 static int __lmtt_alloc_range(struct xe_lmtt *lmtt, struct xe_lmtt_pt *pd, in __lmtt_alloc_range() argument
277 u64 pte_addr_shift = BIT_ULL(lmtt->ops->lmtt_pte_shift(pd->level)); in __lmtt_alloc_range()
281 lmtt_assert(lmtt, pd->level > 0); in __lmtt_alloc_range()
289 pt = lmtt_pt_alloc(lmtt, pd->level - 1); in __lmtt_alloc_range()
295 idx = lmtt->ops->lmtt_pte_index(offset, pd->level); in __lmtt_alloc_range()
296 pde = lmtt->ops->lmtt_pte_encode(pt_addr, pd->level); in __lmtt_alloc_range()
298 lmtt_write_pte(lmtt, pd, pde, idx); in __lmtt_alloc_range()
300 pd->entries[idx] = pt; in __lmtt_alloc_range()
318 struct xe_lmtt_pt *pd = lmtt->pd; in lmtt_alloc_range() local
324 lmtt_assert(lmtt, pd->level > 0); in lmtt_alloc_range()
325 lmtt_assert(lmtt, vfid <= lmtt->ops->lmtt_pte_num(pd->level)); in lmtt_alloc_range()
329 if (pd->entries[vfid]) in lmtt_alloc_range()
332 pt = lmtt_pt_alloc(lmtt, pd->level - 1); in lmtt_alloc_range()
338 pde = lmtt->ops->lmtt_pte_encode(pt_addr, pd->level); in lmtt_alloc_range()
340 lmtt_write_pte(lmtt, pd, pde, vfid); in lmtt_alloc_range()
342 pd->entries[vfid] = pt; in lmtt_alloc_range()
359 struct xe_lmtt_pt *pd = lmtt->pd; in lmtt_leaf_pt() local
362 lmtt_assert(lmtt, vfid <= lmtt->ops->lmtt_pte_num(pd->level)); in lmtt_leaf_pt()
363 pt = pd->entries[vfid]; in lmtt_leaf_pt()
376 lmtt_assert(lmtt, pt->level != pd->level); in lmtt_leaf_pt()
426 lmtt_assert(lmtt, lmtt->pd); in xe_lmtt_prepare_pages()
449 lmtt_assert(lmtt, lmtt->pd); in xe_lmtt_populate_pages()
468 lmtt_assert(lmtt, lmtt->pd); in xe_lmtt_drop_pages()