Lines Matching refs:vma
29 nouveau_vma_unmap(struct nouveau_vma *vma) in nouveau_vma_unmap() argument
31 if (vma->mem) { in nouveau_vma_unmap()
32 nvif_vmm_unmap(&vma->vmm->vmm, vma->addr); in nouveau_vma_unmap()
33 vma->mem = NULL; in nouveau_vma_unmap()
38 nouveau_vma_map(struct nouveau_vma *vma, struct nouveau_mem *mem) in nouveau_vma_map() argument
40 struct nvif_vma tmp = { .addr = vma->addr }; in nouveau_vma_map()
41 int ret = nouveau_mem_map(mem, &vma->vmm->vmm, &tmp); in nouveau_vma_map()
44 vma->mem = mem; in nouveau_vma_map()
51 struct nouveau_vma *vma; in nouveau_vma_find() local
53 list_for_each_entry(vma, &nvbo->vma_list, head) { in nouveau_vma_find()
54 if (vma->vmm == vmm) in nouveau_vma_find()
55 return vma; in nouveau_vma_find()
64 struct nouveau_vma *vma = *pvma; in nouveau_vma_del() local
65 if (vma && --vma->refs <= 0) { in nouveau_vma_del()
66 if (likely(vma->addr != ~0ULL)) { in nouveau_vma_del()
67 struct nvif_vma tmp = { .addr = vma->addr, .size = 1 }; in nouveau_vma_del()
68 nvif_vmm_put(&vma->vmm->vmm, &tmp); in nouveau_vma_del()
70 list_del(&vma->head); in nouveau_vma_del()
81 struct nouveau_vma *vma; in nouveau_vma_new() local
85 if ((vma = *pvma = nouveau_vma_find(nvbo, vmm))) { in nouveau_vma_new()
86 vma->refs++; in nouveau_vma_new()
90 if (!(vma = *pvma = kmalloc(sizeof(*vma), GFP_KERNEL))) in nouveau_vma_new()
92 vma->vmm = vmm; in nouveau_vma_new()
93 vma->refs = 1; in nouveau_vma_new()
94 vma->addr = ~0ULL; in nouveau_vma_new()
95 vma->mem = NULL; in nouveau_vma_new()
96 vma->fence = NULL; in nouveau_vma_new()
97 list_add_tail(&vma->head, &nvbo->vma_list); in nouveau_vma_new()
106 vma->addr = tmp.addr; in nouveau_vma_new()
107 ret = nouveau_vma_map(vma, mem); in nouveau_vma_new()
114 vma->addr = tmp.addr; in nouveau_vma_new()