summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* drm/nouveau: separate buffer object backing memory from nvkm structuresBen Skeggs2017-11-0210-186/+285
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: hang drm client of a masterBen Skeggs2017-11-022-4/+19
| | | | | | | | | | | | | TTM memory allocations will be hanging off the DRM's client, but the locking needed to do so gets really tricky with all the other use of the DRM's object tree. To solve this, we make the normal DRM client a child of a new master, where the memory allocations will be done from instead. This also solves a potential race with client creation. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: consolidate identical functions in nouveau_ttm.cBen Skeggs2017-11-021-46/+17
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: remove unnecessary use of ttm_mem_type_manager::privBen Skeggs2017-11-021-13/+3
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: swap loop order in move_notify() hookBen Skeggs2017-11-021-4/+6
| | | | | | The conditional is the same for every mapping. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: simplify const-va map conditionBen Skeggs2017-11-021-7/+7
| | | | | | | We don't really care about where the memory is, just that it's compatible with a VMA allocated for a given page size. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: split various bo flags out into their own membersBen Skeggs2017-11-026-51/+66
| | | | | | It's far more convenient to deal with like this. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: remove unused sysmem fence codeBen Skeggs2017-11-023-42/+2
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: store nouveau_drm in nouveau_cli, as opposed to drm_deviceBen Skeggs2017-11-024-5/+5
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/gr/gf100-gk208: copy big page size setting from fbBen Skeggs2017-11-021-1/+1
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/gr/gf100-gk208: make use of init_gpc_mmu() hook to share setupBen Skeggs2017-11-0211-20/+29
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fb: finalise big page size selection in constructorBen Skeggs2017-11-0210-26/+32
| | | | | | | MMU will need to know this during its constructor, so we can't delay deciding this until init-time. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/mmu/nv04-nv4x: move global vmm to nvkm_mmuBen Skeggs2017-11-027-21/+18
| | | | | | In a future commit, this will be constructed by common code. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem: use fast-path for resume restoreBen Skeggs2017-11-023-5/+12
| | | | | | | | | Before: "imem: init completed in 299277us" After: "imem: init completed in 11574us" Suspend from Fedora 26 gnome desktop on GP102. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem: use fast-path for suspend backupBen Skeggs2017-11-022-4/+11
| | | | | | | | | Before: "imem: suspend completed in 5540487us" After: "imem: suspend completed in 1871526us" Suspend from Fedora 26 gnome desktop on GP102. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem: separate pre-BAR2-bootstrap objects from the restBen Skeggs2017-11-024-0/+30
| | | | | | These will require slow-path access during suspend/resume. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem: switch to kvmalloc/kvfree for suspend/resume backupBen Skeggs2017-11-021-2/+2
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem: separate suspend/resume backup handling into their own ↵Ben Skeggs2017-11-021-30/+46
| | | | | | functions Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem: remove now-unused wrapper for backend objectsBen Skeggs2017-11-026-170/+2
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem/nv50: support eviction of BAR2 mappingsBen Skeggs2017-11-021-5/+67
| | | | | | | | | | | | A good deal of the structures we map into here aren't accessed very often at all, and Fedora 26 has exposed an issue where after creating a heap of channels, BAR2 space would run out, and we'd need to make use of the slow path while accessing important structures like page tables. This implements an LRU on BAR2 space, which allows eviction of mappings that aren't currently needed, to make space for other objects. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem/nv50: prevent fast-path for mapped objects when BAR isn't readyBen Skeggs2017-11-021-3/+5
| | | | | | | | | Another piece of solving the "GP100 BAR2 VMM bootstrap" puzzle. Without doing this, we'd attempt to write PDEs for the lower page table levels through BAR2 before BAR2 access has been fully initialised. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem/nv50: map bar2 write-combinedBen Skeggs2017-11-021-2/+3
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem/nv50: embed nvkm_instobj directly into nv04_instobjBen Skeggs2017-11-021-32/+102
| | | | | | | | | | | | | | | This is not as simple as it was for earlier GPUs, due to the need to swap accessor functions depending on whether BAR2 is usable or not. We were previously protected by nvkm_instobj's accessor functions keeping an object mapped permanently, with some unclear magic that managed to hit the slow-path where needed even if an object was marked as mapped. That's been replaced here by reference counting maps (some objects, like page tables can be accessed concurrently), and swapping the functions as necessary. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem/nv50: move slow-path locking into rd/wr functionsBen Skeggs2017-11-021-8/+6
| | | | | | | | | | | | | | | | | This is to simplify upcoming changes. The slow-path is something that currently occurs during bootstrap of the BAR2 VMM, while backing up an object during suspend/resume, or when BAR2 address space runs out. The latter is a real problem that can happen at runtime, and occurs in Fedora 26 already (due to some change that causes a lot of channels to be created at login), so ideally we'd prefer not to make it any slower. We'd also like suspend/resume speed to not suffer. Upcoming commits will solve those problems in a better way, making the extra overhead of moving the locking here a non-issue. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem/nv50: split object map out from api functionsBen Skeggs2017-11-021-25/+32
| | | | | | | acquire()/boot() will need different logic in addition to performing the actual mapping. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem/nv40: map bar2 write-combinedBen Skeggs2017-11-021-2/+3
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem/nv40: embed nvkm_instobj directly into nv04_instobjBen Skeggs2017-11-021-7/+7
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem/nv04: directly embed nvkm_instobj into nv04_instobjBen Skeggs2017-11-021-7/+7
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem: allow nvkm_instobj to be directly embedded in backend objectBen Skeggs2017-11-022-13/+38
| | | | | | | This will eliminate a step through the call chain, and give backends more flexibility. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/core/memory: split info pointers from accessor pointersBen Skeggs2017-11-027-118/+155
| | | | | | | | | The accessor functions can change as a result of acquire()/release() calls, and are protected by any refcounting done there. Other functions must remain constant, as they can be called any time. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/imem: add some useful debug outputBen Skeggs2017-11-021-1/+7
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bar/gm107-: wait for instance block binding to completeBen Skeggs2017-11-026-13/+126
| | | | | | | | | Discovered by accident while working to use BAR2 access to instmem objects on more paths. We've apparently been relying on luck up until now! Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bar: initialise bar2 during oneinitBen Skeggs2017-11-022-0/+6
| | | | | | | If we initialise BAR2 earlier, we're able to complete BAR1 setup using the instmem fast-path. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bar: prevent BAR2 mapping of objects during destructorBen Skeggs2017-11-021-1/+1
| | | | | | | | | | | | | | | GP100's page table nests a lot more deeply than the GF100-compatible layout we're currently using, which means our hackish-but-simple way of dealing with BAR2 VMM teardown won't work anymore. In order to sanely handle the chicken-and-egg (BAR2's PTs get mapped into themselves) problem, we need prevent page tables getting mapped back into BAR2 during the destruction of its VMM. To do this, we simply key off the state that's now maintained by the BAR2 init/fini functions. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bar: modify interface to bar2 vmm mappingBen Skeggs2017-11-029-30/+31
| | | | | | Match API with the BAR1 version. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bar: modify interface to bar1 vmm mappingBen Skeggs2017-11-0213-28/+32
| | | | | | | | | | Upcoming changes will remove the nvkm_vmm pointer from nvkm_vma, instead requiring it to be explicitly specified on each operation. It's not currently possible to get this information for BAR1 mappings, so let's fix that ahead of time. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bar: expose interface to bar2 teardownBen Skeggs2017-11-026-1/+29
| | | | | | | | | | Will prevent spurious MMU fault interrupts if something decides to touch BAR1 after we've unloaded the driver. Exposed external to BAR so that INSTMEM can use it to better control the suspend/resume fast-path access. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bar: expose interface to bar2 initialisationBen Skeggs2017-11-028-17/+42
| | | | | | | | | | | | | If we want to be able to hit the instmem fast-path in a few trickier cases, we need to be more flexible with when we can initialise BAR2 access. There's probably a decent case to be made for merging BAR/INSTMEM into BUS, but that's something to ponder another day. Flushes have been added after the write to bind the instance block, as later commits will reveal the need for them. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bar: implement bar1 teardownBen Skeggs2017-11-026-0/+30
| | | | | | | Will prevent spurious MMU fault interrupts if something decides to touch BAR1 after we've unloaded the driver. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bar: move bar1 initialisation into its own functionBen Skeggs2017-11-028-5/+51
| | | | | | | | | BAR2 being done for practical reasons, this is just for consistency. Flushes have been added after the write to bind the instance block, as later commits will reveal the need for them. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bar: swap oneinit/init ordering, and rename bar3 to bar2Ben Skeggs2017-11-025-66/+66
| | | | | | | | | NVIDIA call it BAR2, Linux APIs treat it as BAR3 due to BAR1 being a 64-bit BAR, which I presume take two slots or something. No actual code changes here, just to make future commits less messy. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bar: remove NV_PMC_ENABLE_PFIFO twiddlingBen Skeggs2017-11-022-6/+0
| | | | | | It's handled by FIFO preinit() now. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bar/nv50,g84: drop mmu invalidateBen Skeggs2017-11-026-15/+7
| | | | | | | | | Will already be done by MMU as a result of the PT writes that occur during BAR2 bootstrapping. This is likely just a left-over from the days when it was hardcoded. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fifo: perform reset from preinitBen Skeggs2017-11-023-0/+19
| | | | | | | | RM appears to do this really early in its initialisation, before DEVINIT. We currently do this before BAR2 initialisation for some reason. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/disp: add missing newline in ior debug messagesBen Skeggs2017-11-021-1/+1
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/secboot: add missing newline in debug messageBen Skeggs2017-11-021-1/+1
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/core/device: remove object include to prevent unnecessary rebuildsBen Skeggs2017-11-0217-5/+19
| | | | | | nvkm_device hasn't subclassed nvkm_object in a long time. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/core/subdev: compile out messages for unwanted debug levelsBen Skeggs2017-11-021-1/+1
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/core/gpuobj: remove embedded struct nvkm_objectBen Skeggs2017-11-022-2/+1
| | | | | | nvkm_gpuobj hasn't subclassed nvkm_object in a long time. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/core/object: plumb the unmap ioctl throughBen Skeggs2017-11-024-0/+19
| | | | | | MMU will be using this for BAR mappings. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>