drm/nouveau: insert auxiliary device between nvkm and drm
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest21 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/21 | drm/nouveau: fix a couple of KBuild commentsdrivers/ | +4 | 0 replies | |
| 2/21 | drm/nouveau/nvkm: delay calling subdev ctor()'s until device oneinit()drivers/ drivers/ drivers/ +2 more | +71 | 0 replies | |
| 3/21 | drm/nouveau/nvkm: add nvkm_client_event()drivers/ drivers/ drivers/ +1 more | +11 | 0 replies | |
| 4/21 | drm/nouveau/nvif: add nvif_event_statdrivers/ drivers/ drivers/ +6 more | +16 | 0 replies | |
| 5/21 | drm/nouveau/nvif: add nvif_driver_func for nvkm->drm callbacksdrivers/ drivers/ drivers/ +6 more | +36 | 0 replies | |
| 6/21 | drm/nouveau/nvkm: add init()/exit()drivers/ drivers/ drivers/ +2 more | +54 | 0 replies | |
| 7/21 | drm/nouveau/nvkm: cleanup in nvkm_device_{pci, tegra}_new() on failuredrivers/ drivers/ drivers/ | +24 | 0 replies | |
| 8/21 | drm/nouveau/nvkm: move vgaarb code from drmdrivers/ drivers/ | +32 | 0 replies | |
| 9/21 | drm/nouveau/nvkm: move switcheroo init from drmdrivers/ drivers/ drivers/ +3 more | +362 | 0 replies | |
| 10/21 | drm/nouveau/nvif: add runpm supported flag to device impldrivers/ drivers/ drivers/ +6 more | +39 | 0 replies | |
| 11/21 | drm/nouveau/nvkm: move switcheroo from drmdrivers/ drivers/ drivers/ +6 more | +104 | 0 replies | |
| 12/21 | drm/nouveau/nvkm: prepare pci/tegra probe()/remove() functionsdrivers/ drivers/ drivers/ +3 more | +55 | 0 replies | |
| 13/21 | drm/nouveau/nvkm: move pci probe() defer from drmdrivers/ drivers/ | +5 | 0 replies | |
| 14/21 | drm/nouveau/nvkm: move pci probe() fb handoff from drmdrivers/ drivers/ drivers/ +1 more | +18 | 0 replies | |
| 15/21 | drm/nouveau/nvkm: move pci probe() enable/disable handling from drmdrivers/ drivers/ drivers/ | +3 | 0 replies | |
| 16/21 | drm/nouveau/nvkm: move pci probe() runpm quirk from drmdrivers/ drivers/ drivers/ +1 more | +64 | 0 replies | |
| 17/21 | drm/nouveau/nvkm: move pci pm ops from drmdrivers/ drivers/ drivers/ | +80 | 0 replies | |
| 18/21 | drm/nouveau/nvkm: add device to auxiliary bus for each nvkm_devicedrivers/ drivers/ drivers/ | +37 | 0 replies | |
| 19/21 | drm/nouveau: wrap pm_runtime_* calls with nouveau_runpmdrivers/ drivers/ drivers/ +5 more | +156 | 0 replies | |
| 20/21 | drm/nouveau: probe() against nvkm-provided auxiliary devicesdrivers/ drivers/ drivers/ +10 more | +155 | 0 replies | |
| 21/21 | drm/nouveau/nvkm: s/nouveau/nvkm/ over code moved from drmdrivers/ drivers/ drivers/ +1 more | +64 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 00/21] drm/nouveau: insert auxiliary device between nvkm and drm
This series was originally part of an RFC demonstrating NVKM and the DRM driver split into separate kernel modules, but it became apparent whilst working on this series that there's some benefit to making these changes regardless of a module split, so I'm sending them out separately.
The bulk of the series moves the remaining bus-specific handling (PCI/ platform driver registation, power management, ACPI, etc) out of the DRM driver and into NVKM.
As NVKM finishes probe() for a PCI or Tegra device, it will now register a device on the auxiliary bus, which the DRM driver will probe() against instead of devices from the PCI and platform buses directly.
The result of this is a cleaner integration of support for Tegra GPUs in a codebase that originally assumed a PCI device everywhere. As the DRM driver mostly just operates on objects allocated from NVKM, support for Tegra wasn't *too* bad to integrate, but with NVKM handling some pieces, and the DRM driver handling others, the driver init paths were somewhat convoluted.
With the bus-level device handling now entirely living within NVKM, the DRM driver's init paths for PCI and Tegra GPUs has been unified, which cleans up the remaining messy bits there.
One unanticipated benefit that comes from utilising the auxiliary bus is that, on Optimus systems, it's no longer necessary to fully reinitialise the entire GPU (including time-consuming steps such as booting firmware, or restoring page tables to VRAM) in order to respond to simple queries of the underlying PCI device (ie. running lspci).
Now, NVKM will only wake the PCI device itself when asked by the kernel, and because the remainder of GPU (re)initialisation is tied to clients' object trees, *and* the DRM device is still asleep, no other steps need to be taken, greatly reducing resume latency.
A link to a tree containing the patches is below.
[1] https://gitlab.freedesktop.org/bskeggs/nouveau/-/tree/00.02-auxdev
Ben Skeggs (21):
drm/nouveau: fix a couple of KBuild comments drm/nouveau/nvkm: delay calling subdev ctor()'s until device oneinit() drm/nouveau/nvkm: add nvkm_client_event() drm/nouveau/nvif: add nvif_event_stat
drm/nouveau/nvif: add nvif_driver_func for nvkm->drm callbacks drm/nouveau/nvkm: add init()/exit()
drm/nouveau/nvkm: cleanup in nvkm_device_{pci,tegra}_new() on failure drm/nouveau/nvkm: move vgaarb code from drm drm/nouveau/nvkm: move switcheroo init from drm drm/nouveau/nvif: add runpm supported flag to device impl drm/nouveau/nvkm: move switcheroo from drm drm/nouveau/nvkm: prepare pci/tegra probe()/remove() functions drm/nouveau/nvkm: move pci probe() defer from drm drm/nouveau/nvkm: move pci probe() fb handoff from drm drm/nouveau/nvkm: move pci probe() enable/disable handling from drm drm/nouveau/nvkm: move pci probe() runpm quirk from drm drm/nouveau/nvkm: move pci pm ops from drm drm/nouveau/nvkm: add device to auxiliary bus for each nvkm_device drm/nouveau: wrap pm_runtime_* calls with nouveau_runpm drm/nouveau: probe() against nvkm-provided auxiliary devices drm/nouveau/nvkm: s/nouveau/nvkm/ over code moved from drm
drivers/gpu/drm/nouveau/Kbuild | 11 +-
drivers/gpu/drm/nouveau/Kconfig | 1 +
drivers/gpu/drm/nouveau/dispnv04/crtc.c | 4 +-
drivers/gpu/drm/nouveau/dispnv04/disp.h | 2 +-
drivers/gpu/drm/nouveau/dispnv50/disp.c | 40 +-
drivers/gpu/drm/nouveau/dispnv50/head.c | 2 +-
.../gpu/drm/nouveau/include/nvif/driverif.h | 18 +
drivers/gpu/drm/nouveau/include/nvif/event.h | 7 +-
.../drm/nouveau/include/nvkm/core/client.h | 4 +-
.../drm/nouveau/include/nvkm/core/device.h | 12 +
.../drm/nouveau/include/nvkm/core/module.h | 10 +
.../gpu/drm/nouveau/include/nvkm/core/pci.h | 8 +-
.../gpu/drm/nouveau/include/nvkm/core/tegra.h | 5 +-
drivers/gpu/drm/nouveau/nouveau_acpi.c | 352 ---------------
drivers/gpu/drm/nouveau/nouveau_acpi.h | 10 -
drivers/gpu/drm/nouveau/nouveau_chan.c | 2 +-
drivers/gpu/drm/nouveau/nouveau_connector.c | 16 +-
drivers/gpu/drm/nouveau/nouveau_connector.h | 1 +
drivers/gpu/drm/nouveau/nouveau_debugfs.c | 24 +-
drivers/gpu/drm/nouveau/nouveau_display.c | 19 +-
drivers/gpu/drm/nouveau/nouveau_drm.c | 347 ++++-----------
drivers/gpu/drm/nouveau/nouveau_drv.h | 24 +-
drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +-
drivers/gpu/drm/nouveau/nouveau_gem.c | 30 +-
drivers/gpu/drm/nouveau/nouveau_platform.c | 91 ----
drivers/gpu/drm/nouveau/nouveau_runpm.h | 89 ++++
drivers/gpu/drm/nouveau/nouveau_svm.c | 2 +-
drivers/gpu/drm/nouveau/nouveau_vga.c | 98 +----
drivers/gpu/drm/nouveau/nouveau_vga.h | 3 +-
drivers/gpu/drm/nouveau/nvif/event.c | 9 +
drivers/gpu/drm/nouveau/nvkm/Kbuild | 3 +
drivers/gpu/drm/nouveau/nvkm/core/Kbuild | 2 +-
drivers/gpu/drm/nouveau/nvkm/core/client.c | 17 +-
drivers/gpu/drm/nouveau/nvkm/core/driver.c | 14 +-
drivers/gpu/drm/nouveau/nvkm/core/uevent.c | 2 +-
drivers/gpu/drm/nouveau/nvkm/device/acpi.c | 416 +++++++++++++++++-
drivers/gpu/drm/nouveau/nvkm/device/acpi.h | 19 +
drivers/gpu/drm/nouveau/nvkm/device/base.c | 151 +++++--
drivers/gpu/drm/nouveau/nvkm/device/pci.c | 258 +++++++++--
drivers/gpu/drm/nouveau/nvkm/device/priv.h | 3 +-
drivers/gpu/drm/nouveau/nvkm/device/tegra.c | 87 +++-
drivers/gpu/drm/nouveau/nvkm/device/user.c | 2 +
.../gpu/drm/nouveau/nvkm/engine/disp/uconn.c | 6 +-
.../{nouveau_platform.h => nvkm/module.c} | 45 +-
.../gpu/drm/nouveau/nvkm/subdev/pci/base.c | 30 ++
45 files changed, 1246 insertions(+), 1052 deletions(-)
create mode 100644 drivers/gpu/drm/nouveau/include/nvkm/core/module.h
delete mode 100644 drivers/gpu/drm/nouveau/nouveau_platform.c
create mode 100644 drivers/gpu/drm/nouveau/nouveau_runpm.h
rename drivers/gpu/drm/nouveau/{nouveau_platform.h => nvkm/module.c} (60%)Signature · 1 line
2.44.0