Lines Matching full:mem
36 nouveau_mem_map(struct nouveau_mem *mem, in nouveau_mem_map() argument
54 args.nv50.kind = mem->kind; in nouveau_mem_map()
55 args.nv50.comp = mem->comp; in nouveau_mem_map()
62 if (mem->mem.type & NVIF_MEM_VRAM) in nouveau_mem_map()
68 args.gf100.kind = mem->kind; in nouveau_mem_map()
78 ret = nvif_vmm_map(vmm, vma->addr, mem->mem.size, &args, argc, in nouveau_mem_map()
79 &mem->mem, 0); in nouveau_mem_map()
85 nouveau_mem_fini(struct nouveau_mem *mem) in nouveau_mem_fini() argument
87 nvif_vmm_put(&mem->cli->drm->client.vmm.vmm, &mem->vma[1]); in nouveau_mem_fini()
88 nvif_vmm_put(&mem->cli->drm->client.vmm.vmm, &mem->vma[0]); in nouveau_mem_fini()
89 mutex_lock(&mem->cli->drm->master.lock); in nouveau_mem_fini()
90 nvif_mem_dtor(&mem->mem); in nouveau_mem_fini()
91 mutex_unlock(&mem->cli->drm->master.lock); in nouveau_mem_fini()
97 struct nouveau_mem *mem = nouveau_mem(reg); in nouveau_mem_host() local
98 struct nouveau_cli *cli = mem->cli; in nouveau_mem_host()
107 type = drm->ttm.type_ncoh[!!mem->kind]; in nouveau_mem_host()
111 if (mem->kind && !(mmu->type[type].type & NVIF_MEM_KIND)) in nouveau_mem_host()
112 mem->comp = mem->kind = 0; in nouveau_mem_host()
113 if (mem->comp && !(mmu->type[type].type & NVIF_MEM_COMP)) { in nouveau_mem_host()
115 mem->kind = mmu->kind[mem->kind]; in nouveau_mem_host()
116 mem->comp = 0; in nouveau_mem_host()
124 ret = nvif_mem_ctor_type(mmu, "ttmHostMem", cli->mem->oclass, type, PAGE_SHIFT, in nouveau_mem_host()
126 &args, sizeof(args), &mem->mem); in nouveau_mem_host()
135 struct nouveau_mem *mem = nouveau_mem(reg); in nouveau_mem_vram() local
136 struct nouveau_cli *cli = mem->cli; in nouveau_mem_vram()
145 switch (cli->mem->oclass) { in nouveau_mem_vram()
147 ret = nvif_mem_ctor_type(mmu, "ttmVram", cli->mem->oclass, in nouveau_mem_vram()
152 &mem->mem); in nouveau_mem_vram()
155 ret = nvif_mem_ctor_type(mmu, "ttmVram", cli->mem->oclass, in nouveau_mem_vram()
158 .bankswz = mmu->kind[mem->kind] == 2, in nouveau_mem_vram()
161 &mem->mem); in nouveau_mem_vram()
171 reg->start = mem->mem.addr >> PAGE_SHIFT; in nouveau_mem_vram()
178 struct nouveau_mem *mem = nouveau_mem(reg); in nouveau_mem_del() local
179 if (!mem) in nouveau_mem_del()
181 nouveau_mem_fini(mem); in nouveau_mem_del()
190 struct nouveau_mem *mem; in nouveau_mem_new() local
192 if (!(mem = kzalloc(sizeof(*mem), GFP_KERNEL))) in nouveau_mem_new()
194 mem->cli = cli; in nouveau_mem_new()
195 mem->kind = kind; in nouveau_mem_new()
196 mem->comp = comp; in nouveau_mem_new()
198 reg->mm_node = mem; in nouveau_mem_new()