Loading drivers/gpu/drm/nouveau/include/nvif/class.h +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #define NVIF_CLASS_VMM_NV04 /* if000d.h */ 0x8000000d #define NVIF_CLASS_VMM_NV50 /* if500d.h */ 0x8000500d #define NVIF_CLASS_VMM_GF100 /* if900d.h */ 0x8000900d #define NVIF_CLASS_VMM_GM200 /* ifb00d.h */ 0x8000b00d /* the below match nvidia-assigned (either in hw, or sw) class numbers */ #define NV_NULL_CLASS 0x00000030 Loading drivers/gpu/drm/nouveau/include/nvif/ifb00d.h 0 → 100644 +14 −0 Original line number Diff line number Diff line #ifndef __NVIF_IFB00D_H__ #define __NVIF_IFB00D_H__ #include "if000c.h" struct gm200_vmm_vn { /* nvif_vmm_vX ... */ }; struct gm200_vmm_v0 { /* nvif_vmm_vX ... */ __u8 version; __u8 bigpage; }; #endif drivers/gpu/drm/nouveau/nvkm/subdev/mmu/Kbuild +2 −0 Original line number Diff line number Diff line Loading @@ -20,3 +20,5 @@ nvkm-y += nvkm/subdev/mmu/vmmnv50.o nvkm-y += nvkm/subdev/mmu/vmmgf100.o nvkm-y += nvkm/subdev/mmu/vmmgk104.o nvkm-y += nvkm/subdev/mmu/vmmgk20a.o nvkm-y += nvkm/subdev/mmu/vmmgm200.o nvkm-y += nvkm/subdev/mmu/vmmgm20b.o drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gm200.c +24 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,11 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #include "priv.h" #include "vmm.h" #include <subdev/fb.h> #include <nvif/class.h> static const struct nvkm_mmu_func gm200_mmu = { Loading @@ -34,10 +38,29 @@ gm200_mmu = { .map_sg = gf100_vm_map_sg, .unmap = gf100_vm_unmap, .flush = gf100_vm_flush, .vmm = {{ -1, 0, NVIF_CLASS_VMM_GM200}, gm200_vmm_new }, }; static const struct nvkm_mmu_func gm200_mmu_fixed = { .limit = (1ULL << 40), .dma_bits = 40, .pgt_bits = 27 - 12, .spg_shift = 12, .lpg_shift = 17, .create = gf100_vm_create, .map_pgt = gf100_vm_map_pgt, .map = gf100_vm_map, .map_sg = gf100_vm_map_sg, .unmap = gf100_vm_unmap, .flush = gf100_vm_flush, .vmm = {{ -1, -1, NVIF_CLASS_VMM_GM200}, gm200_vmm_new_fixed }, }; int gm200_mmu_new(struct nvkm_device *device, int index, struct nvkm_mmu **pmmu) { if (device->fb->page) return nvkm_mmu_new_(&gm200_mmu_fixed, device, index, pmmu); return nvkm_mmu_new_(&gm200_mmu, device, index, pmmu); } drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gm20b.c +24 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,11 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #include "priv.h" #include "vmm.h" #include <subdev/fb.h> #include <nvif/class.h> static const struct nvkm_mmu_func gm20b_mmu = { Loading @@ -34,10 +38,29 @@ gm20b_mmu = { .map_sg = gf100_vm_map_sg, .unmap = gf100_vm_unmap, .flush = gf100_vm_flush, .vmm = {{ -1, 0, NVIF_CLASS_VMM_GM200}, gm20b_vmm_new }, }; static const struct nvkm_mmu_func gm20b_mmu_fixed = { .limit = (1ULL << 40), .dma_bits = 40, .pgt_bits = 27 - 12, .spg_shift = 12, .lpg_shift = 17, .create = gf100_vm_create, .map_pgt = gf100_vm_map_pgt, .map = gf100_vm_map, .map_sg = gf100_vm_map_sg, .unmap = gf100_vm_unmap, .flush = gf100_vm_flush, .vmm = {{ -1, -1, NVIF_CLASS_VMM_GM200}, gm20b_vmm_new_fixed }, }; int gm20b_mmu_new(struct nvkm_device *device, int index, struct nvkm_mmu **pmmu) { if (device->fb->page) return nvkm_mmu_new_(&gm20b_mmu_fixed, device, index, pmmu); return nvkm_mmu_new_(&gm20b_mmu, device, index, pmmu); } Loading
drivers/gpu/drm/nouveau/include/nvif/class.h +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #define NVIF_CLASS_VMM_NV04 /* if000d.h */ 0x8000000d #define NVIF_CLASS_VMM_NV50 /* if500d.h */ 0x8000500d #define NVIF_CLASS_VMM_GF100 /* if900d.h */ 0x8000900d #define NVIF_CLASS_VMM_GM200 /* ifb00d.h */ 0x8000b00d /* the below match nvidia-assigned (either in hw, or sw) class numbers */ #define NV_NULL_CLASS 0x00000030 Loading
drivers/gpu/drm/nouveau/include/nvif/ifb00d.h 0 → 100644 +14 −0 Original line number Diff line number Diff line #ifndef __NVIF_IFB00D_H__ #define __NVIF_IFB00D_H__ #include "if000c.h" struct gm200_vmm_vn { /* nvif_vmm_vX ... */ }; struct gm200_vmm_v0 { /* nvif_vmm_vX ... */ __u8 version; __u8 bigpage; }; #endif
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/Kbuild +2 −0 Original line number Diff line number Diff line Loading @@ -20,3 +20,5 @@ nvkm-y += nvkm/subdev/mmu/vmmnv50.o nvkm-y += nvkm/subdev/mmu/vmmgf100.o nvkm-y += nvkm/subdev/mmu/vmmgk104.o nvkm-y += nvkm/subdev/mmu/vmmgk20a.o nvkm-y += nvkm/subdev/mmu/vmmgm200.o nvkm-y += nvkm/subdev/mmu/vmmgm20b.o
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gm200.c +24 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,11 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #include "priv.h" #include "vmm.h" #include <subdev/fb.h> #include <nvif/class.h> static const struct nvkm_mmu_func gm200_mmu = { Loading @@ -34,10 +38,29 @@ gm200_mmu = { .map_sg = gf100_vm_map_sg, .unmap = gf100_vm_unmap, .flush = gf100_vm_flush, .vmm = {{ -1, 0, NVIF_CLASS_VMM_GM200}, gm200_vmm_new }, }; static const struct nvkm_mmu_func gm200_mmu_fixed = { .limit = (1ULL << 40), .dma_bits = 40, .pgt_bits = 27 - 12, .spg_shift = 12, .lpg_shift = 17, .create = gf100_vm_create, .map_pgt = gf100_vm_map_pgt, .map = gf100_vm_map, .map_sg = gf100_vm_map_sg, .unmap = gf100_vm_unmap, .flush = gf100_vm_flush, .vmm = {{ -1, -1, NVIF_CLASS_VMM_GM200}, gm200_vmm_new_fixed }, }; int gm200_mmu_new(struct nvkm_device *device, int index, struct nvkm_mmu **pmmu) { if (device->fb->page) return nvkm_mmu_new_(&gm200_mmu_fixed, device, index, pmmu); return nvkm_mmu_new_(&gm200_mmu, device, index, pmmu); }
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gm20b.c +24 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,11 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #include "priv.h" #include "vmm.h" #include <subdev/fb.h> #include <nvif/class.h> static const struct nvkm_mmu_func gm20b_mmu = { Loading @@ -34,10 +38,29 @@ gm20b_mmu = { .map_sg = gf100_vm_map_sg, .unmap = gf100_vm_unmap, .flush = gf100_vm_flush, .vmm = {{ -1, 0, NVIF_CLASS_VMM_GM200}, gm20b_vmm_new }, }; static const struct nvkm_mmu_func gm20b_mmu_fixed = { .limit = (1ULL << 40), .dma_bits = 40, .pgt_bits = 27 - 12, .spg_shift = 12, .lpg_shift = 17, .create = gf100_vm_create, .map_pgt = gf100_vm_map_pgt, .map = gf100_vm_map, .map_sg = gf100_vm_map_sg, .unmap = gf100_vm_unmap, .flush = gf100_vm_flush, .vmm = {{ -1, -1, NVIF_CLASS_VMM_GM200}, gm20b_vmm_new_fixed }, }; int gm20b_mmu_new(struct nvkm_device *device, int index, struct nvkm_mmu **pmmu) { if (device->fb->page) return nvkm_mmu_new_(&gm20b_mmu_fixed, device, index, pmmu); return nvkm_mmu_new_(&gm20b_mmu, device, index, pmmu); }