Lines Matching +full:charge +full:- +full:vol
4 * Permission is hereby granted, free of charge, to any person obtaining a
45 switch (vmm->object.oclass) { in nouveau_mem_map()
52 args.nv50.kind = mem->kind; in nouveau_mem_map()
53 args.nv50.comp = mem->comp; in nouveau_mem_map()
60 if (mem->mem.type & NVIF_MEM_VRAM) in nouveau_mem_map()
61 args.gf100.vol = 0; in nouveau_mem_map()
63 args.gf100.vol = 1; in nouveau_mem_map()
66 args.gf100.kind = mem->kind; in nouveau_mem_map()
71 return -ENOSYS; in nouveau_mem_map()
74 return nvif_vmm_map(vmm, vma->addr, mem->mem.size, &args, argc, &mem->mem, 0); in nouveau_mem_map()
80 nvif_vmm_put(&mem->cli->drm->client.vmm.vmm, &mem->vma[1]); in nouveau_mem_fini()
81 nvif_vmm_put(&mem->cli->drm->client.vmm.vmm, &mem->vma[0]); in nouveau_mem_fini()
82 mutex_lock(&mem->cli->drm->master.lock); in nouveau_mem_fini()
83 nvif_mem_dtor(&mem->mem); in nouveau_mem_fini()
84 mutex_unlock(&mem->cli->drm->master.lock); in nouveau_mem_fini()
91 struct nouveau_cli *cli = mem->cli; in nouveau_mem_host()
92 struct nouveau_drm *drm = cli->drm; in nouveau_mem_host()
93 struct nvif_mmu *mmu = &cli->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->master.lock); in nouveau_mem_host()
117 ret = nvif_mem_ctor_type(mmu, "ttmHostMem", cli->mem->oclass, type, PAGE_SHIFT, in nouveau_mem_host()
118 reg->num_pages << PAGE_SHIFT, in nouveau_mem_host()
119 &args, sizeof(args), &mem->mem); in nouveau_mem_host()
120 mutex_unlock(&drm->master.lock); in nouveau_mem_host()
128 struct nouveau_cli *cli = mem->cli; in nouveau_mem_vram()
129 struct nouveau_drm *drm = cli->drm; in nouveau_mem_vram()
130 struct nvif_mmu *mmu = &cli->mmu; in nouveau_mem_vram()
131 u64 size = ALIGN(reg->num_pages << PAGE_SHIFT, 1 << page); in nouveau_mem_vram()
134 mutex_lock(&drm->master.lock); in nouveau_mem_vram()
135 switch (cli->mem->oclass) { in nouveau_mem_vram()
137 ret = nvif_mem_ctor_type(mmu, "ttmVram", cli->mem->oclass, in nouveau_mem_vram()
138 drm->ttm.type_vram, page, size, in nouveau_mem_vram()
142 &mem->mem); in nouveau_mem_vram()
145 ret = nvif_mem_ctor_type(mmu, "ttmVram", cli->mem->oclass, in nouveau_mem_vram()
146 drm->ttm.type_vram, page, size, in nouveau_mem_vram()
148 .bankswz = mmu->kind[mem->kind] == 2, in nouveau_mem_vram()
151 &mem->mem); in nouveau_mem_vram()
154 ret = -ENOSYS; in nouveau_mem_vram()
158 mutex_unlock(&drm->master.lock); in nouveau_mem_vram()
160 reg->start = mem->mem.addr >> PAGE_SHIFT; in nouveau_mem_vram()
181 return -ENOMEM; in nouveau_mem_new()
183 mem->cli = cli; in nouveau_mem_new()
184 mem->kind = kind; in nouveau_mem_new()
185 mem->comp = comp; in nouveau_mem_new()
187 *res = &mem->base; in nouveau_mem_new()
199 if (place->fpfn >= (res->start + num_pages) || in nouveau_mem_intersects()
200 (place->lpfn && place->lpfn <= res->start)) in nouveau_mem_intersects()
213 if (res->start < place->fpfn || in nouveau_mem_compatible()
214 (place->lpfn && (res->start + num_pages) > place->lpfn)) in nouveau_mem_compatible()