Lines Matching +full:charge +full:- +full:vol
4 * Permission is hereby granted, free of charge, to any person obtaining a
35 u64 base = (addr >> 8) | map->type; in gf100_vmm_pgt_pte()
38 if (map->ctag && !(map->next & (1ULL << 44))) { in gf100_vmm_pgt_pte()
39 while (ptes--) { in gf100_vmm_pgt_pte()
40 data = base | ((map->ctag >> 1) << 44); in gf100_vmm_pgt_pte()
41 if (!(map->ctag++ & 1)) in gf100_vmm_pgt_pte()
45 base += map->next; in gf100_vmm_pgt_pte()
48 map->type += ptes * map->ctag; in gf100_vmm_pgt_pte()
50 while (ptes--) { in gf100_vmm_pgt_pte()
52 data += map->next; in gf100_vmm_pgt_pte()
68 if (map->page->shift == PAGE_SHIFT) { in gf100_vmm_pgt_dma()
70 nvkm_kmap(pt->memory); in gf100_vmm_pgt_dma()
71 while (ptes--) { in gf100_vmm_pgt_dma()
72 const u64 data = (*map->dma++ >> 8) | map->type; in gf100_vmm_pgt_dma()
74 map->type += map->ctag; in gf100_vmm_pgt_dma()
76 nvkm_done(pt->memory); in gf100_vmm_pgt_dma()
108 struct nvkm_vmm_pt *pgt = pgd->pde[pdei]; in gf100_vmm_pgd_pde()
109 struct nvkm_mmu_pt *pd = pgd->pt[0]; in gf100_vmm_pgd_pde()
113 if ((pt = pgt->pt[0])) { in gf100_vmm_pgd_pde()
114 switch (nvkm_memory_target(pt->memory)) { in gf100_vmm_pgd_pde()
117 data |= BIT_ULL(35); /* VOL */ in gf100_vmm_pgd_pde()
124 data |= pt->addr >> 8; in gf100_vmm_pgd_pde()
127 if ((pt = pgt->pt[1])) { in gf100_vmm_pgd_pde()
128 switch (nvkm_memory_target(pt->memory)) { in gf100_vmm_pgd_pde()
131 data |= BIT_ULL(34); /* VOL */ in gf100_vmm_pgd_pde()
138 data |= pt->addr << 24; in gf100_vmm_pgd_pde()
141 nvkm_kmap(pd->memory); in gf100_vmm_pgd_pde()
143 nvkm_done(pd->memory); in gf100_vmm_pgd_pde()
183 struct nvkm_device *device = vmm->mmu->subdev.device; in gf100_vmm_invalidate_pdb()
190 struct nvkm_device *device = vmm->mmu->subdev.device; in gf100_vmm_invalidate()
191 struct nvkm_mmu_pt *pd = vmm->pd->pt[0]; in gf100_vmm_invalidate()
194 mutex_lock(&vmm->mmu->mutex); in gf100_vmm_invalidate()
204 switch (nvkm_memory_target(pd->memory)) { in gf100_vmm_invalidate()
212 addr |= (vmm->pd->pt[0]->addr >> 12) << 4; in gf100_vmm_invalidate()
214 vmm->func->invalidate_pdb(vmm, addr); in gf100_vmm_invalidate()
224 mutex_unlock(&vmm->mmu->mutex); in gf100_vmm_invalidate()
231 if (atomic_read(&vmm->engref[NVKM_SUBDEV_BAR])) in gf100_vmm_flush()
240 const enum nvkm_memory_target target = nvkm_memory_target(map->memory); in gf100_vmm_valid()
241 const struct nvkm_vmm_page *page = map->page; in gf100_vmm_valid()
242 const bool gm20x = page->desc->func->sparse != NULL; in gf100_vmm_valid()
247 struct nvkm_device *device = vmm->mmu->subdev.device; in gf100_vmm_valid()
248 struct nvkm_memory *memory = map->memory; in gf100_vmm_valid()
249 u8 kind, kind_inv, priv, ro, vol; in gf100_vmm_valid() local
250 int kindn, aper, ret = -ENOSYS; in gf100_vmm_valid()
253 map->next = (1 << page->shift) >> 8; in gf100_vmm_valid()
254 map->type = map->ctag = 0; in gf100_vmm_valid()
256 if (!(ret = nvif_unpack(ret, &argv, &argc, args->v0, 0, 0, false))) { in gf100_vmm_valid()
257 vol = !!args->v0.vol; in gf100_vmm_valid()
258 ro = !!args->v0.ro; in gf100_vmm_valid()
259 priv = !!args->v0.priv; in gf100_vmm_valid()
260 kind = args->v0.kind; in gf100_vmm_valid()
262 if (!(ret = nvif_unvers(ret, &argv, &argc, args->vn))) { in gf100_vmm_valid()
263 vol = target == NVKM_MEM_TARGET_HOST; in gf100_vmm_valid()
272 aper = vmm->func->aper(target); in gf100_vmm_valid()
276 kindm = vmm->mmu->func->kind(vmm->mmu, &kindn, &kind_inv); in gf100_vmm_valid()
279 return -EINVAL; in gf100_vmm_valid()
283 u32 comp = (page->shift == 16 && !gm20x) ? 16 : 17; in gf100_vmm_valid()
285 if (aper != 0 || !(page->type & NVKM_VMM_PAGE_COMP)) { in gf100_vmm_valid()
286 VMM_DEBUG(vmm, "comp %d %02x", aper, page->type); in gf100_vmm_valid()
287 return -EINVAL; in gf100_vmm_valid()
290 if (!map->no_comp) { in gf100_vmm_valid()
293 &map->tags); in gf100_vmm_valid()
300 if (!map->no_comp && map->tags->mn) { in gf100_vmm_valid()
301 u64 tags = map->tags->mn->offset + (map->offset >> 17); in gf100_vmm_valid()
302 if (page->shift == 17 || !gm20x) { in gf100_vmm_valid()
303 map->type |= tags << 44; in gf100_vmm_valid()
304 map->ctag |= 1ULL << 44; in gf100_vmm_valid()
305 map->next |= 1ULL << 44; in gf100_vmm_valid()
307 map->ctag |= tags << 1 | 1; in gf100_vmm_valid()
314 map->type |= BIT(0); in gf100_vmm_valid()
315 map->type |= (u64)priv << 1; in gf100_vmm_valid()
316 map->type |= (u64) ro << 2; in gf100_vmm_valid()
317 map->type |= (u64) vol << 32; in gf100_vmm_valid()
318 map->type |= (u64)aper << 33; in gf100_vmm_valid()
319 map->type |= (u64)kind << 36; in gf100_vmm_valid()
331 return -EINVAL; in gf100_vmm_aper()
344 struct nvkm_mmu_pt *pd = vmm->pd->pt[0]; in gf100_vmm_join_()
346 switch (nvkm_memory_target(pd->memory)) { in gf100_vmm_join_()
349 base |= BIT_ULL(2) /* VOL. */; in gf100_vmm_join_()
354 return -EINVAL; in gf100_vmm_join_()
356 base |= pd->addr; in gf100_vmm_join_()
360 nvkm_wo64(inst, 0x0208, vmm->limit - 1); in gf100_vmm_join_()
408 switch (mmu->subdev.device->fb->page) { in gf100_vmm_new_()
415 return -EINVAL; in gf100_vmm_new_()