nouveau/gk20a: RAM device removal & IOMMU support
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest6 patches 0 repliesNew
- v36 patches 6 repliesSuperseded
- v16 patches 4 repliesSuperseded
Changes in v4 from the cover letter
- Use a single dma_attr for all DMA-API allocations in instmem instead of one per allocation
- Use device.info.ram_size instead of pfb->ram to check whether VRAM is present outside of nvkm
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | make RAM device optionaldrm/ drm/ drm/ +4 more | +57 | 0 replies | |
| 2/6 | instmem/gk20a: move memory allocation to instmemdrm/ drm/ drm/ +2 more | +217 | 0 replies | |
| 3/6 | gk20a: remove RAM devicedrm/ drm/ drm/ +1 more | +0 | 0 replies | |
| 4/6 | instmem/gk20a: use DMA attributesdrm/ lib/ | +51 | 0 replies | |
| 5/6 | platform: probe IOMMU if presentdrm/ drm/ lib/ | +124 | 0 replies | |
| 6/6 | instmem/gk20a: add IOMMU supportdrm/ | +252 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [PATCH v4 0/6] nouveau/gk20a: RAM device removal & IOMMU support
Changes since v3:
- Use a single dma_attr for all DMA-API allocations in instmem instead of one per allocation
- Use device.info.ram_size instead of pfb->ram to check whether VRAM is present outside of nvkm
Changes since v2:
- Cleaner changes for ltc
- Fixed typos in gk20a instmem IOMMU comments
Changes since v1:
- Add missing else condition in ltc
- Remove extra flags that slipped into nouveau_display.c and nv84_fence.c.
Original cover letter:
Patches 1-3 make the presence of a RAM device optional, and remove GK20A's dummy RAM driver we were using so far. On chips using shared memory, such a device can confuse the driver into moving objects where there is no need to, and can trick user-space into believing it can allocate "video" memory that does not exist. By making it possible to run Nouveau without a RAM device and systematically returning errors when VRAM allocations are attempted, we force user-space to do the right thing and always employ the optimal path.
Contiguous memory allocation for GK20A is now handled directly by a custom instmem driver.
The remaining patches are not related to the RAM device removal, but since they touch code that has been moved by patch 2 I took the freedom to include them in this series.
Patch 4 is a little improvement for GK20A's instmem implementation, which suppresses the permanent and unneeded CPU mapping created by the DMA API, and frees up some CPU virtual address space.
Patches 5 and 6 implement initial IOMMU support for GK20A. On top of the GPU MMU, GK20A also has an independent IOMMU that stands between the GPU and the system RAM. Whether RAM accesses are performed directly or using the IOMMU is determined by bit 34 of each address.
If a IOMMU is present, GK20A's instmem takes advantage of it to make unrelated pages of memory appear contiguous to the GPU instead of using the DMA API. Another benefit of the IOMMU is that it can be used by custom VM implementation to make GPU objects allocated via TTM appear contiguous in the IOMMU space, allowing us to maximize the use of large pages and improve performance, but that part will come once the basic support is agreed on and merged.
All in all this series should be largely unintrusive for non-Tegra GPUs, with only patch 1 changing common code parts, in a way that looks safe.
Alexandre Courbot (6):
make RAM device optional
instmem/gk20a: move memory allocation to instmem
gk20a: remove RAM device
instmem/gk20a: use DMA attributes
platform: probe IOMMU if present instmem/gk20a: add IOMMU support
drm/nouveau/include/nvkm/subdev/instmem.h | 1 + drm/nouveau/nouveau_display.c | 9 +- drm/nouveau/nouveau_platform.c | 75 ++++- drm/nouveau/nouveau_platform.h | 18 ++ drm/nouveau/nouveau_ttm.c | 3 + drm/nouveau/nv84_fence.c | 14 +- drm/nouveau/nvkm/engine/device/base.c | 10 +- drm/nouveau/nvkm/engine/device/gk104.c | 2 +- drm/nouveau/nvkm/subdev/clk/base.c | 2 +- drm/nouveau/nvkm/subdev/fb/Kbuild | 1 - drm/nouveau/nvkm/subdev/fb/base.c | 26 +- drm/nouveau/nvkm/subdev/fb/gk20a.c | 1 - drm/nouveau/nvkm/subdev/fb/priv.h | 1 - drm/nouveau/nvkm/subdev/fb/ramgk20a.c | 149 ---------- drm/nouveau/nvkm/subdev/instmem/Kbuild | 1 + drm/nouveau/nvkm/subdev/instmem/gk20a.c | 440 ++++++++++++++++++++++++++++++ drm/nouveau/nvkm/subdev/ltc/gf100.c | 10 +- lib/include/nvif/os.h | 63 +++++ 18 files changed, 655 insertions(+), 171 deletions(-) delete mode 100644 drm/nouveau/nvkm/subdev/fb/ramgk20a.c create mode 100644 drm/nouveau/nvkm/subdev/instmem/gk20a.c
Signature · 6 lines
2.3.0 _______________________________________________ Nouveau mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/nouveau