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