Lines Matching +full:charge +full:- +full:vol
4 * Permission is hereby granted, free of charge, to any person obtaining a
46 switch (vmm->object.oclass) { in nouveau_mem_map()
53 args.nv50.kind = mem->kind; in nouveau_mem_map()
54 args.nv50.comp = mem->comp; in nouveau_mem_map()
61 if (mem->mem.type & NVIF_MEM_VRAM) in nouveau_mem_map()
62 args.gf100.vol = 0; in nouveau_mem_map()
64 args.gf100.vol = 1; in nouveau_mem_map()
67 args.gf100.kind = mem->kind; in nouveau_mem_map()
72 return -ENOSYS; in nouveau_mem_map()
75 return nvif_vmm_map(vmm, vma->addr, mem->mem.size, &args, argc, &mem->mem, 0); in nouveau_mem_map()
81 nvif_vmm_put(&mem->drm->client.vmm.vmm, &mem->vma[1]); in nouveau_mem_fini()
82 nvif_vmm_put(&mem->drm->client.vmm.vmm, &mem->vma[0]); in nouveau_mem_fini()
83 mutex_lock(&mem->drm->client_mutex); in nouveau_mem_fini()
84 nvif_mem_dtor(&mem->mem); in nouveau_mem_fini()
85 mutex_unlock(&mem->drm->client_mutex); in nouveau_mem_fini()
92 struct nouveau_drm *drm = mem->drm; in nouveau_mem_host()
93 struct nvif_mmu *mmu = &drm->mmu; in nouveau_mem_host()
99 type = drm->ttm.type_ncoh[!!mem->kind]; in nouveau_mem_host()
101 type = drm->ttm.type_host[0]; in nouveau_mem_host()
103 if (mem->kind && !(mmu->type[type].type & NVIF_MEM_KIND)) in nouveau_mem_host()
104 mem->comp = mem->kind = 0; in nouveau_mem_host()
105 if (mem->comp && !(mmu->type[type].type & NVIF_MEM_COMP)) { in nouveau_mem_host()
106 if (mmu->object.oclass >= NVIF_CLASS_MMU_GF100) in nouveau_mem_host()
107 mem->kind = mmu->kind[mem->kind]; in nouveau_mem_host()
108 mem->comp = 0; in nouveau_mem_host()
111 if (tt->sg) in nouveau_mem_host()
112 args.sgl = tt->sg->sgl; in nouveau_mem_host()
114 args.dma = tt->dma_address; in nouveau_mem_host()
116 mutex_lock(&drm->client_mutex); in nouveau_mem_host()
117 ret = nvif_mem_ctor_type(mmu, "ttmHostMem", mmu->mem, type, PAGE_SHIFT, in nouveau_mem_host()
118 reg->size, in nouveau_mem_host()
119 &args, sizeof(args), &mem->mem); in nouveau_mem_host()
120 mutex_unlock(&drm->client_mutex); in nouveau_mem_host()
128 struct nouveau_drm *drm = mem->drm; in nouveau_mem_vram()
129 struct nvif_mmu *mmu = &drm->mmu; in nouveau_mem_vram()
130 u64 size = ALIGN(reg->size, 1 << page); in nouveau_mem_vram()
133 mutex_lock(&drm->client_mutex); in nouveau_mem_vram()
134 switch (mmu->mem) { in nouveau_mem_vram()
136 ret = nvif_mem_ctor_type(mmu, "ttmVram", mmu->mem, in nouveau_mem_vram()
137 drm->ttm.type_vram, page, size, in nouveau_mem_vram()
141 &mem->mem); in nouveau_mem_vram()
144 ret = nvif_mem_ctor_type(mmu, "ttmVram", mmu->mem, in nouveau_mem_vram()
145 drm->ttm.type_vram, page, size, in nouveau_mem_vram()
147 .bankswz = mmu->kind[mem->kind] == 2, in nouveau_mem_vram()
150 &mem->mem); in nouveau_mem_vram()
153 ret = -ENOSYS; in nouveau_mem_vram()
157 mutex_unlock(&drm->client_mutex); in nouveau_mem_vram()
159 reg->start = mem->mem.addr >> PAGE_SHIFT; in nouveau_mem_vram()
180 return -ENOMEM; in nouveau_mem_new()
182 mem->drm = drm; in nouveau_mem_new()
183 mem->kind = kind; in nouveau_mem_new()
184 mem->comp = comp; in nouveau_mem_new()
186 *res = &mem->base; in nouveau_mem_new()
198 if (place->fpfn >= (res->start + num_pages) || in nouveau_mem_intersects()
199 (place->lpfn && place->lpfn <= res->start)) in nouveau_mem_intersects()
212 if (res->start < place->fpfn || in nouveau_mem_compatible()
213 (place->lpfn && (res->start + num_pages) > place->lpfn)) in nouveau_mem_compatible()