summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2017-11-02drm/nouveau: queue delayed unmapping of VMAs on client workqueueBen Skeggs1-6/+30
VMAs are about to not take references on the VMM they belong to, which means more care is required when handling delayed unmapping. Queuing it on the client workqueue ensures all pending VMA unmaps will have completed before the VMM is destroyed. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau: implement per-client delayed workqueue with fence supportBen Skeggs2-0/+70
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau: determine memory class for each clientBen Skeggs2-0/+17
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau: pass handle of vmm object to channel allocation ioctlsBen Skeggs17-41/+54
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau: switch to vmm limitBen Skeggs2-8/+6
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau: allocate vmm object for every clientBen Skeggs6-36/+44
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau: replace use of cpu_coherent with memory typesBen Skeggs1-2/+11
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau: use nvif_mmu_type to determine BAR1 cachingBen Skeggs2-2/+3
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau: fetch memory type indices that we care about for ttmBen Skeggs2-1/+32
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau: consolidate handling of dma maskBen Skeggs3-44/+13
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau: check kind validity against mmu objectBen Skeggs1-2/+12
This is already handled in the top-level gem_new() ioctl in another manner, but this will be removed in a future commit. Ideally we'd not need to check up-front at all, and let the VMM code handle error checking, but there are paths in the current BO management code where this isn't possible due to map() not always being called during BO creation, and map() calls not being allowed to fail during buffer migration. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau: allocate mmu object for every clientBen Skeggs2-0/+22
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau: remove trivial cases of nvxx_device() usageBen Skeggs2-37/+31
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu: define user interfaces to mmu vmm opertaionsBen Skeggs8-0/+647
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu: define user interfaces to mmu memory allocationBen Skeggs12-1/+363
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu: define user interfaces to mmuBen Skeggs24-1/+413
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu/gf100-: type-based vram allocation and bar mappingBen Skeggs12-0/+140
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu/nv50,g84: type-based vram allocation and bar mappingBen Skeggs7-0/+124
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu/nv04-nv4x: type-based vram allocation and bar mappingBen Skeggs8-0/+93
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu: add base for type-based memory allocationBen Skeggs6-0/+275
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu: build up information on available memory typesBen Skeggs11-0/+151
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau: remove explicit unmapsBen Skeggs3-12/+3
If the VMA is being deleted, we don't need to explicity unmap first anymore. The MMU code will automatically merge the operations into a single page tree walk. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/gr/gf100-: replace hardcoded instance/vmm setup in grctx generationBen Skeggs1-52/+58
Could be useful for if/when a future GPU removes support for the GF100 PT layout. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/gr/gf100-: use new interfaces for vmm operationsBen Skeggs10-52/+39
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/fifo/gf100-: use new interfaces for vmm operationsBen Skeggs8-36/+28
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/secboot/gm200: use new interfaces for vmm operationsBen Skeggs1-6/+5
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/imem/nv50-: use new interfaces for vmm operationsBen Skeggs2-32/+41
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/fb/ram: use new interfaces for vmm operationsBen Skeggs1-4/+14
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/fifo: initialise vmm with new interfacesBen Skeggs10-57/+31
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/secboot/gm200: initialise vmm with new interfacesBen Skeggs2-10/+10
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/bar/gf100: initialise vmm with new interfacesBen Skeggs2-18/+14
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/bar/nv50: initialise vmm with new interfacesBen Skeggs2-18/+19
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu: implement new vmm frontendBen Skeggs8-154/+858
These are the new priviledged interfaces to the VMM backends, and expose some functionality that wasn't previously available. It's now possible to allocate a chunk of address-space (even all of it), without causing page tables to be allocated up-front, and then map into it at arbitrary locations. This is the basic primitive used to support features such as sparse mapping, or to allow userspace control over its own address-space, or HMM (where the GPU driver isn't in control of the address-space layout). Rather than being tied to a subtle combination of memory object and VMA properties, arguments that control map flags (ro, kind, etc) are passed explicitly at map time. The compatibility hacks to implement the old frontend on top of the new driver backends have been replaced with something similar to implement the old frontend's interfaces on top of the new frontend. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu: remove support for old backendsBen Skeggs16-358/+3
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu/gp100,gp10b: implement new vmm backendBen Skeggs10-133/+281
Adds support for: - 64KiB/2MiB big page sizes (128KiB not supported by HW with new PT layout). - System-memory PTs. - LPTE "invalid" state. - (Tegra) Use of video memory aperture. - Sparse PDEs/PTEs. - Additional blocklinear kinds. - 49-bit address-space. GP100 supports an entirely new 5-level page table layout that provides an expanded 49-bit address-space. It also supports the layout present on previous generations, which we've been making do with until now. This commit implements support for the new layout, and enables it by default. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu/gm200,gm20b: implement new vmm backendBen Skeggs6-20/+101
Adds support for: - 64KiB big page size. - System-memory PTs. - LPTE "invalid" state. - (Tegra) Use of video memory aperture. - Sparse PDEs/PTEs. - Additional blocklinear kinds. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu/gk104,gk20a: implement new vmm backendBen Skeggs5-10/+41
Adds support for: - 64KiB big page size. - System-memory PTs. - LPTE "invalid" state. - (Tegra) Use of video memory aperture. Adds support for marking LPTEs invalid, resulting in the corresponding SPTEs being ignored, which is supposed to speed up TLB invalidates. On The Tegra side, this will switch to using the video memory aperture for all mappings. The HW will still target non-coherent system memory, but this aperture needs to be selected in order to support compression. Tegra's instmem backend somewhat cheated to get this effect previously. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu/gf100: implement new vmm backendBen Skeggs6-5/+306
Adds support for: - 64KiB big page size. - System-memory PTs. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu/nv50,g84: implement new vmm backendBen Skeggs6-194/+360
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu/nv44: implement new vmm backendBen Skeggs2-141/+168
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu/nv41: implement new vmm backendBen Skeggs2-69/+64
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu/nv04: implement new vmm backendBen Skeggs4-58/+62
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu: implement new vmm backendBen Skeggs5-3/+836
This is the common code to support a rework of the VMM backends. It adds support for more than 2 levels of page table nesting, which is required to be able to support GP100's MMU layout. Sparse mappings (that don't cause MMU faults when accessed) are now supported, where the backend provides it. Dual-PT handling had to become more sophisticated to support sparse, but this also allows us to support an optimisation the MMU provides on GK104 and newer. Certain operations can now be combined into a single page tree walk to avoid some overhead, but also enables optimsations like skipping PTE unmap writes when the PT will be destroyed anyway. The old backend has been hacked up to forward requests onto the new backend, if present, so that it's possible to bisect between issues in the backend changes vs the upcoming frontend changes. Until the new frontend has been merged, new backends will leak BAR2 page tables on module unload. This is expected, and it's not worth the effort of hacking around this as it doesn't effect runtime. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/fb/gm200: enable NV_PFB_MMU_CTRL_USE_FULL_COMP_TAG_LINE where ↵Ben Skeggs1-3/+3
appropriate To avoid wasting compression tags when using 64KiB pages, we need to enable this so we can select between upper/lower comptagline in PTEs. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/ltc/gm200: limit NV_MMU_PTE_COMPTAGLINE bits to 16 where requiredBen Skeggs1-2/+3
If NV_PFB_MMU_CTRL_USE_FULL_COMP_TAG_LINE is TRUE, then the last bit of NV_MMU_PTE_COMPTAGLINE is re-purposed to select the upper/lower half of a compression tag when using 64KiB big pages. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/fifo/nv04-nv40: fix missing nvkm_kmap() calls around ramfc accessBen Skeggs1-0/+2
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu: handle instance block setupBen Skeggs20-192/+93
We previously required each VMM user to allocate their own page directory and fill in the instance block themselves. It makes more sense to handle this in a common location. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu: remove old vm creation hooksBen Skeggs9-65/+1
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/mmu/gp100,gp10b: implement vmm on top of new baseBen Skeggs8-24/+179
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>
2017-11-02drm/nouveau/mmu/gm200,gm20b: implement vmm on top of new baseBen Skeggs8-2/+303
Adds support for: - Per-VMM selection of big page size. - System-memory PDs. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>