Lines Matching refs:pt
18 struct i915_page_table *pt; in alloc_pt() local
20 pt = kmalloc(sizeof(*pt), I915_GFP_ALLOW_FAIL); in alloc_pt()
21 if (unlikely(!pt)) in alloc_pt()
24 pt->base = vm->alloc_pt_dma(vm, sz); in alloc_pt()
25 if (IS_ERR(pt->base)) { in alloc_pt()
26 kfree(pt); in alloc_pt()
30 pt->is_compact = false; in alloc_pt()
31 atomic_set(&pt->used, 0); in alloc_pt()
32 return pt; in alloc_pt()
61 pd->pt.base = vm->alloc_pt_dma(vm, I915_GTT_PAGE_SIZE_4K); in alloc_pd()
62 if (IS_ERR(pd->pt.base)) { in alloc_pd()
71 void free_px(struct i915_address_space *vm, struct i915_page_table *pt, int lvl) in free_px() argument
73 BUILD_BUG_ON(offsetof(struct i915_page_directory, pt)); in free_px()
77 container_of(pt, typeof(*pd), pt); in free_px()
81 if (pt->base) in free_px()
82 i915_gem_object_put(pt->base); in free_px()
84 kfree(pt); in free_px()
127 struct i915_page_table * const pt, in release_pd_entry() argument
132 if (atomic_add_unless(&pt->used, -1, 1)) in release_pd_entry()
136 if (atomic_dec_and_test(&pt->used)) { in release_pd_entry()
244 struct i915_page_table *pt; in i915_vm_alloc_pt_stash() local
246 pt = alloc_pt(vm, pt_sz); in i915_vm_alloc_pt_stash()
247 if (IS_ERR(pt)) { in i915_vm_alloc_pt_stash()
249 return PTR_ERR(pt); in i915_vm_alloc_pt_stash()
252 pt->stash = stash->pt[0]; in i915_vm_alloc_pt_stash()
253 stash->pt[0] = pt; in i915_vm_alloc_pt_stash()
268 pd->pt.stash = stash->pt[1]; in i915_vm_alloc_pt_stash()
269 stash->pt[1] = &pd->pt; in i915_vm_alloc_pt_stash()
279 struct i915_page_table *pt; in i915_vm_map_pt_stash() local
282 for (n = 0; n < ARRAY_SIZE(stash->pt); n++) { in i915_vm_map_pt_stash()
283 for (pt = stash->pt[n]; pt; pt = pt->stash) { in i915_vm_map_pt_stash()
284 err = map_pt_dma_locked(vm, pt->base); in i915_vm_map_pt_stash()
296 struct i915_page_table *pt; in i915_vm_free_pt_stash() local
299 for (n = 0; n < ARRAY_SIZE(stash->pt); n++) { in i915_vm_free_pt_stash()
300 while ((pt = stash->pt[n])) { in i915_vm_free_pt_stash()
301 stash->pt[n] = pt->stash; in i915_vm_free_pt_stash()
302 free_px(vm, pt, n); in i915_vm_free_pt_stash()