summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp100.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2017-11-01 03:56:19 +1000
committerBen Skeggs <bskeggs@redhat.com>2017-11-02 13:32:26 +1000
commit8e39abff45888a54b3d9dc20434940dabeda077f (patch)
treed6d8875035befe93e45f416a2a3506513251dfed /drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp100.c
parent5f300fed645597689f1e6fed8800fc7e3d01e212 (diff)
drm/nouveau/mmu/gp100,gp10b: implement vmm on top of new base
Adds support for: - Selection of old/new-style page table layout (GP100MmuLayout=0/1). - System-memory PDs. New layout disabled by default for the moment, as we don't have a backend that can handle it yet. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp100.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp100.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp100.c
index 6cfd325ea3a9..b1ba864b4b35 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gp100.c
@@ -19,25 +19,24 @@
* 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 <core/option.h>
+
+#include <nvif/class.h>
static const struct nvkm_mmu_func
gp100_mmu = {
- .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,
+ .limit = (1ULL << 49),
+ .dma_bits = 47,
+ .lpg_shift = 16,
+ .vmm = {{ -1, -1, NVIF_CLASS_VMM_GP100}, gp100_vmm_new },
};
int
gp100_mmu_new(struct nvkm_device *device, int index, struct nvkm_mmu **pmmu)
{
+ if (!nvkm_boolopt(device->cfgopt, "GP100MmuLayout", false))
+ return gm200_mmu_new(device, index, pmmu);
return nvkm_mmu_new_(&gp100_mmu, device, index, pmmu);
}