xref: /linux/drivers/gpu/drm/nouveau/nouveau_vmm.h (revision 44f57d78)
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 	struct nouveau_fence *fence;
16 };
17 
18 struct nouveau_vma *nouveau_vma_find(struct nouveau_bo *, struct nouveau_vmm *);
19 int nouveau_vma_new(struct nouveau_bo *, struct nouveau_vmm *,
20 		    struct nouveau_vma **);
21 void nouveau_vma_del(struct nouveau_vma **);
22 int nouveau_vma_map(struct nouveau_vma *, struct nouveau_mem *);
23 void nouveau_vma_unmap(struct nouveau_vma *);
24 
25 struct nouveau_vmm {
26 	struct nouveau_cli *cli;
27 	struct nvif_vmm vmm;
28 	struct nouveau_svmm *svmm;
29 };
30 
31 int nouveau_vmm_init(struct nouveau_cli *, s32 oclass, struct nouveau_vmm *);
32 void nouveau_vmm_fini(struct nouveau_vmm *);
33 #endif
34