xref: /linux/drivers/gpu/drm/nouveau/nouveau_vmm.h (revision 0b5eca67bd2d0e6f6d0ccdc316aced0cc4bf2e9f)
1 #ifndef __NOUVEAU_VMA_H__
2 #define __NOUVEAU_VMA_H__
3 #include <nvif/vmm.h>
4 struct nouveau_bo;
5 struct nouveau_mem;
6 
7 struct nouveau_vma {
8 	struct nouveau_vmm *vmm;
9 	int refs;
10 	struct list_head head;
11 	u64 addr;
12 
13 	struct nouveau_mem *mem;
14 };
15 
16 struct nouveau_vma *nouveau_vma_find(struct nouveau_bo *, struct nouveau_vmm *);
17 int nouveau_vma_new(struct nouveau_bo *, struct nouveau_vmm *,
18 		    struct nouveau_vma **);
19 void nouveau_vma_del(struct nouveau_vma **);
20 int nouveau_vma_map(struct nouveau_vma *, struct nouveau_mem *);
21 void nouveau_vma_unmap(struct nouveau_vma *);
22 
23 struct nouveau_vmm {
24 	struct nouveau_cli *cli;
25 	struct nvif_vmm vmm;
26 	struct nvkm_vm *vm;
27 };
28 
29 int nouveau_vmm_init(struct nouveau_cli *, s32 oclass, struct nouveau_vmm *);
30 void nouveau_vmm_fini(struct nouveau_vmm *);
31 #endif
32