]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h
drm/nouveau/mmu: implement page table sub-allocation
[mirror_ubuntu-bionic-kernel.git] / drivers / gpu / drm / nouveau / include / nvkm / subdev / mmu.h
index dcd3deff27a49eb73b947851034191e33369d5cf..40e21f23b41d6688d9531a04067d4ea56e85e3f5 100644 (file)
@@ -2,7 +2,7 @@
 #define __NVKM_MMU_H__
 #include <core/subdev.h>
 #include <core/mm.h>
-struct nvkm_device;
+struct nvkm_gpuobj;
 struct nvkm_mem;
 
 struct nvkm_vm_pgt {
@@ -16,11 +16,12 @@ struct nvkm_vm_pgd {
 };
 
 struct nvkm_vma {
-       struct list_head head;
-       int refcount;
        struct nvkm_vm *vm;
        struct nvkm_mm_node *node;
-       u64 offset;
+       union {
+               u64 offset;
+               u64 addr;
+       };
        u32 access;
 };
 
@@ -37,6 +38,8 @@ struct nvkm_vm {
        struct nvkm_vm_pgt *pgt;
        u32 fpde;
        u32 lpde;
+
+       bool bootstrapped;
 };
 
 int  nvkm_vm_new(struct nvkm_device *, u64 offset, u64 length, u64 mm_offset,
@@ -58,11 +61,25 @@ struct nvkm_mmu {
        u64 limit;
        u8  dma_bits;
        u8  lpg_shift;
+
+       struct nvkm_vmm *vmm;
+
+       struct {
+               struct mutex mutex;
+               struct list_head list;
+       } ptc, ptp;
 };
 
 int nv04_mmu_new(struct nvkm_device *, int, struct nvkm_mmu **);
 int nv41_mmu_new(struct nvkm_device *, int, struct nvkm_mmu **);
 int nv44_mmu_new(struct nvkm_device *, int, struct nvkm_mmu **);
 int nv50_mmu_new(struct nvkm_device *, int, struct nvkm_mmu **);
+int g84_mmu_new(struct nvkm_device *, int, struct nvkm_mmu **);
 int gf100_mmu_new(struct nvkm_device *, int, struct nvkm_mmu **);
+int gk104_mmu_new(struct nvkm_device *, int, struct nvkm_mmu **);
+int gk20a_mmu_new(struct nvkm_device *, int, struct nvkm_mmu **);
+int gm200_mmu_new(struct nvkm_device *, int, struct nvkm_mmu **);
+int gm20b_mmu_new(struct nvkm_device *, int, struct nvkm_mmu **);
+int gp100_mmu_new(struct nvkm_device *, int, struct nvkm_mmu **);
+int gp10b_mmu_new(struct nvkm_device *, int, struct nvkm_mmu **);
 #endif