Lines Matching refs:pt

34 	struct nvkm_mmu_pt *pt;  member
42 nvkm_mmu_ptp_put(struct nvkm_mmu *mmu, bool force, struct nvkm_mmu_pt *pt) in nvkm_mmu_ptp_put() argument
44 const int slot = pt->base >> pt->ptp->shift; in nvkm_mmu_ptp_put()
45 struct nvkm_mmu_ptp *ptp = pt->ptp; in nvkm_mmu_ptp_put()
56 nvkm_mmu_ptc_put(mmu, force, &ptp->pt); in nvkm_mmu_ptp_put()
61 kfree(pt); in nvkm_mmu_ptp_put()
67 struct nvkm_mmu_pt *pt; in nvkm_mmu_ptp_get() local
71 if (!(pt = kzalloc(sizeof(*pt), GFP_KERNEL))) in nvkm_mmu_ptp_get()
78 kfree(pt); in nvkm_mmu_ptp_get()
82 ptp->pt = nvkm_mmu_ptc_get(mmu, 0x1000, 0x1000, false); in nvkm_mmu_ptp_get()
83 if (!ptp->pt) { in nvkm_mmu_ptp_get()
85 kfree(pt); in nvkm_mmu_ptp_get()
90 slot = nvkm_memory_size(ptp->pt->memory) >> ptp->shift; in nvkm_mmu_ptp_get()
95 pt->ptp = ptp; in nvkm_mmu_ptp_get()
96 pt->sub = true; in nvkm_mmu_ptp_get()
106 pt->memory = pt->ptp->pt->memory; in nvkm_mmu_ptp_get()
107 pt->base = slot << ptp->shift; in nvkm_mmu_ptp_get()
108 pt->addr = pt->ptp->pt->addr + pt->base; in nvkm_mmu_ptp_get()
109 return pt; in nvkm_mmu_ptp_get()
143 struct nvkm_mmu_pt *pt = *ppt; in nvkm_mmu_ptc_put() local
144 if (pt) { in nvkm_mmu_ptc_put()
146 if (pt->sub) { in nvkm_mmu_ptc_put()
148 nvkm_mmu_ptp_put(mmu, force, pt); in nvkm_mmu_ptc_put()
155 if (pt->ptc->refs < 8 /* Heuristic. */ && !force) { in nvkm_mmu_ptc_put()
156 list_add_tail(&pt->head, &pt->ptc->item); in nvkm_mmu_ptc_put()
157 pt->ptc->refs++; in nvkm_mmu_ptc_put()
159 nvkm_memory_unref(&pt->memory); in nvkm_mmu_ptc_put()
160 kfree(pt); in nvkm_mmu_ptc_put()
170 struct nvkm_mmu_pt *pt; in nvkm_mmu_ptc_get() local
176 pt = nvkm_mmu_ptp_get(mmu, align, zero); in nvkm_mmu_ptc_get()
178 return pt; in nvkm_mmu_ptc_get()
190 pt = list_first_entry_or_null(&ptc->item, typeof(*pt), head); in nvkm_mmu_ptc_get()
191 if (pt) { in nvkm_mmu_ptc_get()
193 nvkm_fo64(pt->memory, 0, 0, size >> 3); in nvkm_mmu_ptc_get()
194 list_del(&pt->head); in nvkm_mmu_ptc_get()
197 return pt; in nvkm_mmu_ptc_get()
202 if (!(pt = kmalloc(sizeof(*pt), GFP_KERNEL))) in nvkm_mmu_ptc_get()
204 pt->ptc = ptc; in nvkm_mmu_ptc_get()
205 pt->sub = false; in nvkm_mmu_ptc_get()
208 size, align, zero, &pt->memory); in nvkm_mmu_ptc_get()
210 kfree(pt); in nvkm_mmu_ptc_get()
214 pt->base = 0; in nvkm_mmu_ptc_get()
215 pt->addr = nvkm_memory_addr(pt->memory); in nvkm_mmu_ptc_get()
216 return pt; in nvkm_mmu_ptc_get()
224 struct nvkm_mmu_pt *pt, *tt; in nvkm_mmu_ptc_dump() local
225 list_for_each_entry_safe(pt, tt, &ptc->item, head) { in nvkm_mmu_ptc_dump()
226 nvkm_memory_unref(&pt->memory); in nvkm_mmu_ptc_dump()
227 list_del(&pt->head); in nvkm_mmu_ptc_dump()
228 kfree(pt); in nvkm_mmu_ptc_dump()