]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h
7fa60d79ec4c290ffd2d945c081b4e9b04417f86
3 #include <core/subdev.h>
7 struct nvkm_memory
*mem
[2];
12 struct list_head head
;
16 bool mapref
:1; /* PTs (de)referenced on (un)map (vs pre-allocated). */
17 bool sparse
:1; /* Unmapped PDEs/PTEs will not trigger MMU faults. */
18 #define NVKM_VMA_PAGE_NONE 7
19 u8 page
:3; /* Requested page type (index, or NONE for automatic). */
20 u8 refd
:3; /* Current page type (index, or NONE for unreferenced). */
21 bool used
:1; /* Region allocated. */
22 bool part
:1; /* Region was split from an allocated region by map(). */
23 bool user
:1; /* Region user-allocated. */
24 bool busy
:1; /* Region busy (for temporarily preventing user access). */
25 struct nvkm_memory
*memory
; /* Memory currently mapped into VMA. */
26 struct nvkm_tags
*tags
; /* Compression tag reference. */
28 struct nvkm_vma
*node
;
35 const struct nvkm_vmm_func
*func
;
45 struct nvkm_vmm_pt
*pd
;
46 struct list_head join
;
48 struct list_head list
;
53 atomic_t engref
[NVKM_SUBDEV_NR
];
59 int nvkm_vm_new(struct nvkm_device
*, u64 offset
, u64 length
, u64 mm_offset
,
60 struct lock_class_key
*, struct nvkm_vm
**);
61 int nvkm_vm_ref(struct nvkm_vm
*, struct nvkm_vm
**, struct nvkm_memory
*inst
);
62 int nvkm_vm_boot(struct nvkm_vm
*, u64 size
);
63 int nvkm_vm_get(struct nvkm_vm
*, u64 size
, u32 page_shift
, u32 access
,
65 void nvkm_vm_put(struct nvkm_vma
*);
66 void nvkm_vm_map(struct nvkm_vma
*, struct nvkm_mem
*);
67 void nvkm_vm_map_at(struct nvkm_vma
*, u64 offset
, struct nvkm_mem
*);
68 void nvkm_vm_unmap(struct nvkm_vma
*);
70 int nvkm_vmm_new(struct nvkm_device
*, u64 addr
, u64 size
, void *argv
, u32 argc
,
71 struct lock_class_key
*, const char *name
, struct nvkm_vmm
**);
72 struct nvkm_vmm
*nvkm_vmm_ref(struct nvkm_vmm
*);
73 void nvkm_vmm_unref(struct nvkm_vmm
**);
74 int nvkm_vmm_boot(struct nvkm_vmm
*);
75 int nvkm_vmm_join(struct nvkm_vmm
*, struct nvkm_memory
*inst
);
76 void nvkm_vmm_part(struct nvkm_vmm
*, struct nvkm_memory
*inst
);
77 int nvkm_vmm_get(struct nvkm_vmm
*, u8 page
, u64 size
, struct nvkm_vma
**);
78 void nvkm_vmm_put(struct nvkm_vmm
*, struct nvkm_vma
**);
81 struct nvkm_memory
*memory
;
84 struct nvkm_mm_node
*mem
;
85 struct scatterlist
*sgl
;
89 const struct nvkm_vmm_page
*page
;
91 struct nvkm_tags
*tags
;
97 int nvkm_vmm_map(struct nvkm_vmm
*, struct nvkm_vma
*, void *argv
, u32 argc
,
98 struct nvkm_vmm_map
*);
99 void nvkm_vmm_unmap(struct nvkm_vmm
*, struct nvkm_vma
*);
101 struct nvkm_vmm
*nvkm_uvmm_search(struct nvkm_client
*, u64 handle
);
104 const struct nvkm_mmu_func
*func
;
105 struct nvkm_subdev subdev
;
111 struct nvkm_vmm
*vmm
;
115 struct list_head list
;
119 int nv04_mmu_new(struct nvkm_device
*, int, struct nvkm_mmu
**);
120 int nv41_mmu_new(struct nvkm_device
*, int, struct nvkm_mmu
**);
121 int nv44_mmu_new(struct nvkm_device
*, int, struct nvkm_mmu
**);
122 int nv50_mmu_new(struct nvkm_device
*, int, struct nvkm_mmu
**);
123 int g84_mmu_new(struct nvkm_device
*, int, struct nvkm_mmu
**);
124 int gf100_mmu_new(struct nvkm_device
*, int, struct nvkm_mmu
**);
125 int gk104_mmu_new(struct nvkm_device
*, int, struct nvkm_mmu
**);
126 int gk20a_mmu_new(struct nvkm_device
*, int, struct nvkm_mmu
**);
127 int gm200_mmu_new(struct nvkm_device
*, int, struct nvkm_mmu
**);
128 int gm20b_mmu_new(struct nvkm_device
*, int, struct nvkm_mmu
**);
129 int gp100_mmu_new(struct nvkm_device
*, int, struct nvkm_mmu
**);
130 int gp10b_mmu_new(struct nvkm_device
*, int, struct nvkm_mmu
**);