drm/nouveau/mmu: remove support for old backends
authorBen Skeggs <bskeggs@redhat.com>
Tue, 31 Oct 2017 17:56:19 +0000 (03:56 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 2 Nov 2017 03:32:30 +0000 (13:32 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
16 files changed:
drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h
drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h
drivers/gpu/drm/nouveau/nouveau_mem.c
drivers/gpu/drm/nouveau/nouveau_mem.h
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/g84.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gf100.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk104.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gk20a.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gm200.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gm20b.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv04.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv41.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv44.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv50.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/priv.h

index e1776506746b21101f83ee4541a1b7cc7a2b0c82..5b5ff5a9a127160751ff4f00f610132040d0ec7c 100644 (file)
@@ -23,7 +23,6 @@
 #define NV_MEM_COMP_VM 0x03
 
 struct nvkm_mem {
-       struct nvkm_mm_node *tag;
        struct nvkm_mm_node *mem;
        dma_addr_t *pages;
        u32 memtype;
index ccd87d508d048d32e3d51304e8ea876f8e645c49..630c3cbaf2b92d46cb4f6808b8a017bdaf70458e 100644 (file)
@@ -39,9 +39,6 @@ struct nvkm_vm {
 
        struct nvkm_mm mm;
        struct kref refcount;
-       struct nvkm_vm_pgt *pgt;
-       u32 fpde;
-       u32 lpde;
 
        bool bootstrapped;
        atomic_t engref[NVKM_SUBDEV_NR];
index 21d904ded441ff7212ab2d8e50ed975110741688..70fbe5e72b55c7c4d3e43b7077cf7c216598622f 100644 (file)
@@ -23,8 +23,6 @@
 #include "nouveau_drv.h"
 #include "nouveau_bo.h"
 
-#include <subdev/ltc.h>
-
 #include <drm/ttm/ttm_bo_driver.h>
 
 int
@@ -46,8 +44,6 @@ nouveau_mem_fini(struct nouveau_mem *mem)
                nvkm_vm_unmap(&mem->vma[0]);
                nvkm_vm_put(&mem->vma[0]);
        }
-       nvkm_memory_tags_put(&mem->memory, nvxx_device(&mem->cli->device),
-                            &mem->tags);
 }
 
 int
@@ -112,32 +108,6 @@ nouveau_mem_vram(struct ttm_mem_reg *reg, bool contig, u8 page)
 
        mem->_mem->size = size >> NVKM_RAM_MM_SHIFT;
        mem->_mem->offset = nvkm_memory_addr(mem->_mem->memory);
-
-       if (cli->device.info.chipset < 0xc0 && mem->comp) {
-               if (page == 16) {
-                       ret = nvkm_memory_tags_get(mem->_mem->memory, device,
-                                                  size >> page, NULL,
-                                                  &mem->tags);
-                       WARN_ON(ret);
-               }
-               if (!mem->tags || !mem->tags->mn)
-                       mem->comp = 0;
-       } else
-       if (cli->device.info.chipset >= 0xc0 &&
-           gf100_pte_storage_type_map[mem->kind] != mem->kind) {
-               if (page == 17) {
-                       ret = nvkm_memory_tags_get(mem->_mem->memory, device,
-                                                  size >> page,
-                                                  nvkm_ltc_tags_clear,
-                                                  &mem->tags);
-                       WARN_ON(ret);
-               }
-               if (!mem->tags || !mem->tags->mn)
-                       mem->kind = gf100_pte_storage_type_map[mem->kind];
-       }
-
-       if (mem->tags && mem->tags->mn)
-               mem->_mem->tag = mem->tags->mn;
        mem->_mem->mem = ((struct nvkm_vram *)mem->_mem->memory)->mn;
        mem->_mem->memtype = (mem->comp << 7) | mem->kind;
 
index 89e9e7b9b00cab30d1cb942c5442a105fbf3f0c1..20930ebc5e21d10f157833eff2edf4523f3c37bc 100644 (file)
@@ -25,7 +25,6 @@ struct nouveau_mem {
        struct nvkm_vma bar_vma;
 
        struct nvkm_memory memory;
-       struct nvkm_tags *tags;
 };
 
 enum nvif_vmm_get {
index 741021ff8c27ecd3f68d44ef9f4b71c8cfe73365..31832398f1e98ebcb984274d26afc6e5f8214cbb 100644 (file)
@@ -24,7 +24,6 @@
 #include "priv.h"
 #include "vmm.h"
 
-#include <core/gpuobj.h>
 #include <subdev/fb.h>
 
 #include <nvif/if500d.h>
@@ -316,17 +315,6 @@ void
 nvkm_vm_map_at(struct nvkm_vma *vma, u64 delta, struct nvkm_mem *node)
 {
        const struct nvkm_vmm_page *page = vma->vm->func->page;
-       struct nvkm_vm *vm = vma->vm;
-       struct nvkm_mmu *mmu = vm->mmu;
-       struct nvkm_mm_node *r = node->mem;
-       int big = vma->node->type != mmu->func->spg_shift;
-       u32 offset = vma->node->offset + (delta >> 12);
-       u32 bits = vma->node->type - 12;
-       u32 pde  = (offset >> mmu->func->pgt_bits) - vm->fpde;
-       u32 pte  = (offset & ((1 << mmu->func->pgt_bits) - 1)) >> bits;
-       u32 max  = 1 << (mmu->func->pgt_bits - bits);
-       u32 end, len;
-
        if (page->desc->func->unmap) {
                struct nvkm_vmm_map map = { .mem = node->mem };
                while (page->shift != vma->node->type)
@@ -334,36 +322,6 @@ nvkm_vm_map_at(struct nvkm_vma *vma, u64 delta, struct nvkm_mem *node)
                nvkm_vm_map_(page, vma, delta, node, page->desc->func->mem, &map);
                return;
        }
-
-       delta = 0;
-       while (r) {
-               u64 phys = (u64)r->offset << 12;
-               u32 num  = r->length >> bits;
-
-               while (num) {
-                       struct nvkm_memory *pgt = vm->pgt[pde].mem[big];
-
-                       end = (pte + num);
-                       if (unlikely(end >= max))
-                               end = max;
-                       len = end - pte;
-
-                       mmu->func->map(vma, pgt, node, pte, len, phys, delta);
-
-                       num -= len;
-                       pte += len;
-                       if (unlikely(end >= max)) {
-                               phys += len << (bits + 12);
-                               pde++;
-                               pte = 0;
-                       }
-
-                       delta += (u64)len << vma->node->type;
-               }
-               r = r->next;
-       }
-
-       mmu->func->flush(vm);
 }
 
 static void
@@ -371,20 +329,6 @@ nvkm_vm_map_sg_table(struct nvkm_vma *vma, u64 delta, u64 length,
                     struct nvkm_mem *mem)
 {
        const struct nvkm_vmm_page *page = vma->vm->func->page;
-       struct nvkm_vm *vm = vma->vm;
-       struct nvkm_mmu *mmu = vm->mmu;
-       int big = vma->node->type != mmu->func->spg_shift;
-       u32 offset = vma->node->offset + (delta >> 12);
-       u32 bits = vma->node->type - 12;
-       u32 num  = length >> vma->node->type;
-       u32 pde  = (offset >> mmu->func->pgt_bits) - vm->fpde;
-       u32 pte  = (offset & ((1 << mmu->func->pgt_bits) - 1)) >> bits;
-       u32 max  = 1 << (mmu->func->pgt_bits - bits);
-       unsigned m, sglen;
-       u32 end, len;
-       int i;
-       struct scatterlist *sg;
-
        if (page->desc->func->unmap) {
                struct nvkm_vmm_map map = { .sgl = mem->sg->sgl };
                while (page->shift != vma->node->type)
@@ -392,45 +336,6 @@ nvkm_vm_map_sg_table(struct nvkm_vma *vma, u64 delta, u64 length,
                nvkm_vm_map_(page, vma, delta, mem, page->desc->func->sgl, &map);
                return;
        }
-
-       for_each_sg(mem->sg->sgl, sg, mem->sg->nents, i) {
-               struct nvkm_memory *pgt = vm->pgt[pde].mem[big];
-               sglen = sg_dma_len(sg) >> PAGE_SHIFT;
-
-               end = pte + sglen;
-               if (unlikely(end >= max))
-                       end = max;
-               len = end - pte;
-
-               for (m = 0; m < len; m++) {
-                       dma_addr_t addr = sg_dma_address(sg) + (m << PAGE_SHIFT);
-
-                       mmu->func->map_sg(vma, pgt, mem, pte, 1, &addr);
-                       num--;
-                       pte++;
-
-                       if (num == 0)
-                               goto finish;
-               }
-               if (unlikely(end >= max)) {
-                       pde++;
-                       pte = 0;
-               }
-               if (m < sglen) {
-                       for (; m < sglen; m++) {
-                               dma_addr_t addr = sg_dma_address(sg) + (m << PAGE_SHIFT);
-
-                               mmu->func->map_sg(vma, pgt, mem, pte, 1, &addr);
-                               num--;
-                               pte++;
-                               if (num == 0)
-                                       goto finish;
-                       }
-               }
-
-       }
-finish:
-       mmu->func->flush(vm);
 }
 
 static void
@@ -438,18 +343,6 @@ nvkm_vm_map_sg(struct nvkm_vma *vma, u64 delta, u64 length,
               struct nvkm_mem *mem)
 {
        const struct nvkm_vmm_page *page = vma->vm->func->page;
-       struct nvkm_vm *vm = vma->vm;
-       struct nvkm_mmu *mmu = vm->mmu;
-       dma_addr_t *list = mem->pages;
-       int big = vma->node->type != mmu->func->spg_shift;
-       u32 offset = vma->node->offset + (delta >> 12);
-       u32 bits = vma->node->type - 12;
-       u32 num  = length >> vma->node->type;
-       u32 pde  = (offset >> mmu->func->pgt_bits) - vm->fpde;
-       u32 pte  = (offset & ((1 << mmu->func->pgt_bits) - 1)) >> bits;
-       u32 max  = 1 << (mmu->func->pgt_bits - bits);
-       u32 end, len;
-
        if (page->desc->func->unmap) {
                struct nvkm_vmm_map map = { .dma = mem->pages };
                while (page->shift != vma->node->type)
@@ -457,27 +350,6 @@ nvkm_vm_map_sg(struct nvkm_vma *vma, u64 delta, u64 length,
                nvkm_vm_map_(page, vma, delta, mem, page->desc->func->dma, &map);
                return;
        }
-
-       while (num) {
-               struct nvkm_memory *pgt = vm->pgt[pde].mem[big];
-
-               end = (pte + num);
-               if (unlikely(end >= max))
-                       end = max;
-               len = end - pte;
-
-               mmu->func->map_sg(vma, pgt, mem, pte, len, list);
-
-               num  -= len;
-               pte  += len;
-               list += len;
-               if (unlikely(end >= max)) {
-                       pde++;
-                       pte = 0;
-               }
-       }
-
-       mmu->func->flush(vm);
 }
 
 void
@@ -496,16 +368,6 @@ void
 nvkm_vm_unmap_at(struct nvkm_vma *vma, u64 delta, u64 length)
 {
        struct nvkm_vm *vm = vma->vm;
-       struct nvkm_mmu *mmu = vm->mmu;
-       int big = vma->node->type != mmu->func->spg_shift;
-       u32 offset = vma->node->offset + (delta >> 12);
-       u32 bits = vma->node->type - 12;
-       u32 num  = length >> vma->node->type;
-       u32 pde  = (offset >> mmu->func->pgt_bits) - vm->fpde;
-       u32 pte  = (offset & ((1 << mmu->func->pgt_bits) - 1)) >> bits;
-       u32 max  = 1 << (mmu->func->pgt_bits - bits);
-       u32 end, len;
-
        if (vm->func->page->desc->func->unmap) {
                const struct nvkm_vmm_page *page = vm->func->page;
                while (page->shift != vma->node->type)
@@ -516,26 +378,6 @@ nvkm_vm_unmap_at(struct nvkm_vma *vma, u64 delta, u64 length)
                mutex_unlock(&vm->mutex);
                return;
        }
-
-       while (num) {
-               struct nvkm_memory *pgt = vm->pgt[pde].mem[big];
-
-               end = (pte + num);
-               if (unlikely(end >= max))
-                       end = max;
-               len = end - pte;
-
-               mmu->func->unmap(vma, pgt, pte, len);
-
-               num -= len;
-               pte += len;
-               if (unlikely(end >= max)) {
-                       pde++;
-                       pte = 0;
-               }
-       }
-
-       mmu->func->flush(vm);
 }
 
 void
@@ -547,63 +389,12 @@ nvkm_vm_unmap(struct nvkm_vma *vma)
        nvkm_memory_unref(&vma->memory);
 }
 
-static void
-nvkm_vm_unmap_pgt(struct nvkm_vm *vm, int big, u32 fpde, u32 lpde)
-{
-       struct nvkm_mmu *mmu = vm->mmu;
-       struct nvkm_vm_pgt *vpgt;
-       struct nvkm_memory *pgt;
-       u32 pde;
-
-       for (pde = fpde; pde <= lpde; pde++) {
-               vpgt = &vm->pgt[pde - vm->fpde];
-               if (--vpgt->refcount[big])
-                       continue;
-
-               pgt = vpgt->mem[big];
-               vpgt->mem[big] = NULL;
-
-               if (mmu->func->map_pgt)
-                       mmu->func->map_pgt(vm, pde, vpgt->mem);
-
-               mmu->func->flush(vm);
-
-               nvkm_memory_unref(&pgt);
-       }
-}
-
-static int
-nvkm_vm_map_pgt(struct nvkm_vm *vm, u32 pde, u32 type)
-{
-       struct nvkm_mmu *mmu = vm->mmu;
-       struct nvkm_vm_pgt *vpgt = &vm->pgt[pde - vm->fpde];
-       int big = (type != mmu->func->spg_shift);
-       u32 pgt_size;
-       int ret;
-
-       pgt_size  = (1 << (mmu->func->pgt_bits + 12)) >> type;
-       pgt_size *= 8;
-
-       ret = nvkm_memory_new(mmu->subdev.device, NVKM_MEM_TARGET_INST,
-                             pgt_size, 0x1000, true, &vpgt->mem[big]);
-       if (unlikely(ret))
-               return ret;
-
-       if (mmu->func->map_pgt)
-               mmu->func->map_pgt(vm, pde, vpgt->mem);
-
-       vpgt->refcount[big]++;
-       return 0;
-}
-
 int
 nvkm_vm_get(struct nvkm_vm *vm, u64 size, u32 page_shift, u32 access,
            struct nvkm_vma *vma)
 {
-       struct nvkm_mmu *mmu = vm->mmu;
        u32 align = (1 << page_shift) >> 12;
        u32 msize = size >> 12;
-       u32 fpde, lpde, pde;
        int ret;
 
        mutex_lock(&vm->mutex);
@@ -626,32 +417,7 @@ nvkm_vm_get(struct nvkm_vm *vm, u64 size, u32 page_shift, u32 access,
                        mutex_unlock(&vm->mutex);
                        return ret;
                }
-
-               goto done;
-       }
-
-       fpde = (vma->node->offset >> mmu->func->pgt_bits);
-       lpde = (vma->node->offset + vma->node->length - 1) >> mmu->func->pgt_bits;
-
-       for (pde = fpde; pde <= lpde; pde++) {
-               struct nvkm_vm_pgt *vpgt = &vm->pgt[pde - vm->fpde];
-               int big = (vma->node->type != mmu->func->spg_shift);
-
-               if (likely(vpgt->refcount[big])) {
-                       vpgt->refcount[big]++;
-                       continue;
-               }
-
-               ret = nvkm_vm_map_pgt(vm, pde, vma->node->type);
-               if (ret) {
-                       if (pde != fpde)
-                               nvkm_vm_unmap_pgt(vm, big, fpde, pde - 1);
-                       nvkm_mm_free(&vm->mm, &vma->node);
-                       mutex_unlock(&vm->mutex);
-                       return ret;
-               }
        }
-done:
        mutex_unlock(&vm->mutex);
 
        vma->memory = NULL;
@@ -668,7 +434,6 @@ nvkm_vm_put(struct nvkm_vma *vma)
 {
        struct nvkm_mmu *mmu;
        struct nvkm_vm *vm;
-       u32 fpde, lpde;
 
        if (unlikely(vma->node == NULL))
                return;
@@ -678,9 +443,6 @@ nvkm_vm_put(struct nvkm_vma *vma)
        nvkm_memory_tags_put(vma->memory, mmu->subdev.device, &vma->tags);
        nvkm_memory_unref(&vma->memory);
 
-       fpde = (vma->node->offset >> mmu->func->pgt_bits);
-       lpde = (vma->node->offset + vma->node->length - 1) >> mmu->func->pgt_bits;
-
        mutex_lock(&vm->mutex);
        if (vm->func->page->desc->func->unmap) {
                const struct nvkm_vmm_page *page = vm->func->page;
@@ -689,11 +451,8 @@ nvkm_vm_put(struct nvkm_vma *vma)
 
                nvkm_vmm_ptes_put(vm, page, vma->node->offset << 12,
                                            vma->node->length << 12);
-               goto done;
        }
 
-       nvkm_vm_unmap_pgt(vm, vma->node->type != mmu->func->spg_shift, fpde, lpde);
-done:
        nvkm_mm_free(&vm->mm, &vma->node);
        mutex_unlock(&vm->mutex);
 
@@ -703,23 +462,7 @@ done:
 int
 nvkm_vm_boot(struct nvkm_vm *vm, u64 size)
 {
-       struct nvkm_mmu *mmu = vm->mmu;
-       struct nvkm_memory *pgt;
-       int ret;
-
-       if (vm->func->page->desc->func->unmap)
-               return nvkm_vmm_boot(vm);
-
-       ret = nvkm_memory_new(mmu->subdev.device, NVKM_MEM_TARGET_INST,
-                             (size >> mmu->func->spg_shift) * 8, 0x1000, true, &pgt);
-       if (ret == 0) {
-               vm->pgt[0].refcount[0] = 1;
-               vm->pgt[0].mem[0] = pgt;
-               nvkm_memory_boot(pgt, vm);
-               vm->bootstrapped = true;
-       }
-
-       return ret;
+       return nvkm_vmm_boot(vm);
 }
 
 static int
@@ -730,24 +473,14 @@ nvkm_vm_legacy(struct nvkm_mmu *mmu, u64 offset, u64 length, u64 mm_offset,
        int ret;
 
        kref_init(&vm->refcount);
-       vm->fpde = offset >> (mmu->func->pgt_bits + 12);
-       vm->lpde = (offset + length - 1) >> (mmu->func->pgt_bits + 12);
-
-       vm->pgt  = vzalloc((vm->lpde - vm->fpde + 1) * sizeof(*vm->pgt));
-       if (!vm->pgt) {
-               kfree(vm);
-               return -ENOMEM;
-       }
 
        if (block > length)
                block = length;
 
        ret = nvkm_mm_init(&vm->mm, 0, mm_offset >> 12, mm_length >> 12,
                           block >> 12);
-       if (ret) {
-               vfree(vm->pgt);
+       if (ret)
                return ret;
-       }
 
        return 0;
 }
@@ -786,7 +519,6 @@ nvkm_vm_del(struct kref *kref)
        struct nvkm_vm *vm = container_of(kref, typeof(*vm), refcount);
 
        nvkm_mm_fini(&vm->mm);
-       vfree(vm->pgt);
        if (vm->func)
                nvkm_vmm_dtor(vm);
        kfree(vm);
@@ -797,14 +529,9 @@ nvkm_vm_ref(struct nvkm_vm *ref, struct nvkm_vm **ptr, struct nvkm_memory *inst)
 {
        if (ref) {
                if (ref->func->join && inst) {
-                       int ret = ref->func->join(ref, inst), i;
+                       int ret = ref->func->join(ref, inst);
                        if (ret)
                                return ret;
-
-                       if (!ref->func->page->desc->func->unmap && ref->mmu->func->map_pgt) {
-                               for (i = ref->fpde; i <= ref->lpde; i++)
-                                       ref->mmu->func->map_pgt(ref, i, ref->pgt[i - ref->fpde].mem);
-                       }
                }
 
                kref_get(&ref->refcount);
@@ -813,12 +540,6 @@ nvkm_vm_ref(struct nvkm_vm *ref, struct nvkm_vm **ptr, struct nvkm_memory *inst)
        if (*ptr) {
                if ((*ptr)->func->part && inst)
                        (*ptr)->func->part(*ptr, inst);
-               if ((*ptr)->bootstrapped && inst) {
-                       if (!(*ptr)->func->page->desc->func->unmap) {
-                               nvkm_memory_unref(&(*ptr)->pgt[0].mem[0]);
-                               (*ptr)->bootstrapped = false;
-                       }
-               }
                kref_put(&(*ptr)->refcount, nvkm_vm_del);
        }
 
@@ -838,9 +559,6 @@ nvkm_mmu_oneinit(struct nvkm_subdev *subdev)
                        return ret;
        }
 
-       if (mmu->func->oneinit)
-               return mmu->func->oneinit(mmu);
-
        return 0;
 }
 
index e436c610b3df57732eca1a9f63d2cb75ef509e04..c90c9980478bed74d5978a841115628475343952 100644 (file)
@@ -27,8 +27,6 @@ static const struct nvkm_mmu_func
 g84_mmu = {
        .limit = (1ULL << 40),
        .dma_bits = 40,
-       .pgt_bits  = 29 - 12,
-       .spg_shift = 12,
        .lpg_shift = 16,
        .vmm = {{ -1, -1, NVIF_CLASS_VMM_NV50}, nv50_vmm_new, false, 0x0200 },
        .kind = nv50_mmu_kind,
index 24e2d933524d39484416c378152032a644980e61..ca5ca27188cda6c5883630bbf35cd596875a10c1 100644 (file)
@@ -75,8 +75,6 @@ static const struct nvkm_mmu_func
 gf100_mmu = {
        .limit = (1ULL << 40),
        .dma_bits = 40,
-       .pgt_bits  = 27 - 12,
-       .spg_shift = 12,
        .lpg_shift = 17,
        .vmm = {{ -1, -1, NVIF_CLASS_VMM_GF100}, gf100_vmm_new },
        .kind = gf100_mmu_kind,
index 8cbd0723c25b6797b6b8e1039cec2485607ef578..db7353aa25dfdafc1e13f97a886068d3ca92450e 100644 (file)
@@ -27,8 +27,6 @@ static const struct nvkm_mmu_func
 gk104_mmu = {
        .limit = (1ULL << 40),
        .dma_bits = 40,
-       .pgt_bits  = 27 - 12,
-       .spg_shift = 12,
        .lpg_shift = 17,
        .vmm = {{ -1, -1, NVIF_CLASS_VMM_GF100}, gk104_vmm_new },
        .kind = gf100_mmu_kind,
index 57def7244d38513adddde8b7119a1078e5092cd1..2dfe8b1ba109c4e830f99e9a85d6ce85356c2be8 100644 (file)
@@ -27,8 +27,6 @@ static const struct nvkm_mmu_func
 gk20a_mmu = {
        .limit = (1ULL << 40),
        .dma_bits = 40,
-       .pgt_bits  = 27 - 12,
-       .spg_shift = 12,
        .lpg_shift = 17,
        .vmm = {{ -1, -1, NVIF_CLASS_VMM_GF100}, gk20a_vmm_new },
        .kind = gf100_mmu_kind,
index c38c899e463cdf0471ffc646a65fd707c37ffbe3..a9628baf53722715ca496a62b171c6df8b8b20c3 100644 (file)
@@ -71,8 +71,6 @@ static const struct nvkm_mmu_func
 gm200_mmu = {
        .limit = (1ULL << 40),
        .dma_bits = 40,
-       .pgt_bits  = 27 - 12,
-       .spg_shift = 12,
        .lpg_shift = 17,
        .vmm = {{ -1,  0, NVIF_CLASS_VMM_GM200}, gm200_vmm_new },
        .kind = gm200_mmu_kind,
@@ -82,8 +80,6 @@ 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,
        .vmm = {{ -1, -1, NVIF_CLASS_VMM_GM200}, gm200_vmm_new_fixed },
        .kind = gm200_mmu_kind,
index 8cd6d1617bd728a741b22d6aace0b7c8bee33f5c..5d14c138af025b43e7d35e6f15fb058cd3cff45d 100644 (file)
@@ -29,8 +29,6 @@ static const struct nvkm_mmu_func
 gm20b_mmu = {
        .limit = (1ULL << 40),
        .dma_bits = 40,
-       .pgt_bits  = 27 - 12,
-       .spg_shift = 12,
        .lpg_shift = 17,
        .vmm = {{ -1,  0, NVIF_CLASS_VMM_GM200}, gm20b_vmm_new },
        .kind = gm200_mmu_kind,
@@ -40,8 +38,6 @@ 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,
        .vmm = {{ -1, -1, NVIF_CLASS_VMM_GM200}, gm20b_vmm_new_fixed },
        .kind = gm200_mmu_kind,
index 13438dbc60632c680854b9fb69f885ddb2896c74..3ae70e218bc03c8f746792abd215f13b20fbbc9d 100644 (file)
@@ -31,8 +31,6 @@ const struct nvkm_mmu_func
 nv04_mmu = {
        .limit = NV04_PDMA_SIZE,
        .dma_bits = 32,
-       .pgt_bits = 32 - 12,
-       .spg_shift = 12,
        .lpg_shift = 12,
        .vmm = {{ -1, -1, NVIF_CLASS_VMM_NV04}, nv04_vmm_new, true },
 };
index 457cf509591b7bcdcf0917d8b81551635f552380..5bcbc10d8564855cb9cd12fe7dc92cf65e463d3c 100644 (file)
@@ -43,8 +43,6 @@ nv41_mmu = {
        .init = nv41_mmu_init,
        .limit = NV41_GART_SIZE,
        .dma_bits = 39,
-       .pgt_bits = 32 - 12,
-       .spg_shift = 12,
        .lpg_shift = 12,
        .vmm = {{ -1, -1, NVIF_CLASS_VMM_NV04}, nv41_vmm_new, true },
 };
index 2072139bff4dc0e9219b4bfbec20132ccb2cbbd7..998287021e3f8b91c1ee56113f167c9a0d4fcf87 100644 (file)
@@ -58,8 +58,6 @@ nv44_mmu = {
        .init = nv44_mmu_init,
        .limit = NV44_GART_SIZE,
        .dma_bits = 39,
-       .pgt_bits = 32 - 12,
-       .spg_shift = 12,
        .lpg_shift = 12,
        .vmm = {{ -1, -1, NVIF_CLASS_VMM_NV04}, nv44_vmm_new, true },
 };
index 31d6f9626e56cec852726c7e8bcf40a1cc7f2e9f..7af1f89fe004f07f74095eefbc2ae4bfd71a2732 100644 (file)
@@ -63,8 +63,6 @@ static const struct nvkm_mmu_func
 nv50_mmu = {
        .limit = (1ULL << 40),
        .dma_bits = 40,
-       .pgt_bits  = 29 - 12,
-       .spg_shift = 12,
        .lpg_shift = 16,
        .vmm = {{ -1, -1, NVIF_CLASS_VMM_NV50}, nv50_vmm_new, false, 0x1400 },
        .kind = nv50_mmu_kind,
index 08d211d9fc55de0a9b97d49124f5895694bbb2dc..bc4571a206902260e79d6d2c3c25d19ea8c07d0d 100644 (file)
@@ -9,26 +9,12 @@ int nvkm_mmu_new_(const struct nvkm_mmu_func *, struct nvkm_device *,
                  int index, struct nvkm_mmu **);
 
 struct nvkm_mmu_func {
-       int (*oneinit)(struct nvkm_mmu *);
        void (*init)(struct nvkm_mmu *);
 
        u64 limit;
        u8  dma_bits;
-       u32 pgt_bits;
-       u8  spg_shift;
        u8  lpg_shift;
 
-       void (*map_pgt)(struct nvkm_vmm *, u32 pde,
-                       struct nvkm_memory *pgt[2]);
-       void (*map)(struct nvkm_vma *, struct nvkm_memory *,
-                   struct nvkm_mem *, u32 pte, u32 cnt,
-                   u64 phys, u64 delta);
-       void (*map_sg)(struct nvkm_vma *, struct nvkm_memory *,
-                      struct nvkm_mem *, u32 pte, u32 cnt, dma_addr_t *);
-       void (*unmap)(struct nvkm_vma *, struct nvkm_memory *pgt,
-                     u32 pte, u32 cnt);
-       void (*flush)(struct nvkm_vm *);
-
        struct {
                struct nvkm_sclass user;
                int (*ctor)(struct nvkm_mmu *, u64 addr, u64 size,