Lines Matching refs:pt
17 struct i915_page_table *pt; in alloc_pt() local
19 pt = kmalloc(sizeof(*pt), I915_GFP_ALLOW_FAIL); in alloc_pt()
20 if (unlikely(!pt)) in alloc_pt()
23 pt->base = vm->alloc_pt_dma(vm, I915_GTT_PAGE_SIZE_4K); in alloc_pt()
24 if (IS_ERR(pt->base)) { in alloc_pt()
25 kfree(pt); in alloc_pt()
29 atomic_set(&pt->used, 0); in alloc_pt()
30 return pt; in alloc_pt()
59 pd->pt.base = vm->alloc_pt_dma(vm, I915_GTT_PAGE_SIZE_4K); in alloc_pd()
60 if (IS_ERR(pd->pt.base)) { in alloc_pd()
69 void free_px(struct i915_address_space *vm, struct i915_page_table *pt, int lvl) in free_px() argument
71 BUILD_BUG_ON(offsetof(struct i915_page_directory, pt)); in free_px()
75 container_of(pt, typeof(*pd), pt); in free_px()
79 if (pt->base) in free_px()
80 i915_gem_object_put(pt->base); in free_px()
82 kfree(pt); in free_px()
125 struct i915_page_table * const pt, in release_pd_entry() argument
130 if (atomic_add_unless(&pt->used, -1, 1)) in release_pd_entry()
134 if (atomic_dec_and_test(&pt->used)) { in release_pd_entry()
229 struct i915_page_table *pt; in i915_vm_alloc_pt_stash() local
231 pt = alloc_pt(vm); in i915_vm_alloc_pt_stash()
232 if (IS_ERR(pt)) { in i915_vm_alloc_pt_stash()
234 return PTR_ERR(pt); in i915_vm_alloc_pt_stash()
237 pt->stash = stash->pt[0]; in i915_vm_alloc_pt_stash()
238 stash->pt[0] = pt; in i915_vm_alloc_pt_stash()
253 pd->pt.stash = stash->pt[1]; in i915_vm_alloc_pt_stash()
254 stash->pt[1] = &pd->pt; in i915_vm_alloc_pt_stash()
264 struct i915_page_table *pt; in i915_vm_map_pt_stash() local
267 for (n = 0; n < ARRAY_SIZE(stash->pt); n++) { in i915_vm_map_pt_stash()
268 for (pt = stash->pt[n]; pt; pt = pt->stash) { in i915_vm_map_pt_stash()
269 err = map_pt_dma_locked(vm, pt->base); in i915_vm_map_pt_stash()
281 struct i915_page_table *pt; in i915_vm_free_pt_stash() local
284 for (n = 0; n < ARRAY_SIZE(stash->pt); n++) { in i915_vm_free_pt_stash()
285 while ((pt = stash->pt[n])) { in i915_vm_free_pt_stash()
286 stash->pt[n] = pt->stash; in i915_vm_free_pt_stash()
287 free_px(vm, pt, n); in i915_vm_free_pt_stash()