RFC Lima DRM driver
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest24 patches 46 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/24 | ARM: dts: add gpu node to exynos4arch/ | +33 | 1 reply | |
| 2/24 | dt-bindings: add switch-delay property for mali-utgardDocumentation/ | +4 | 2 replies | |
| 3/24 | arm64/dts: add switch-delay for meson maliarch/ | +1 | 2 replies | |
| 4/24 | arm64/dts: add switch-delay for meson maliarch/ | +1 | 1 reply | |
| 5/24 | Revert "drm: Nerf the preclose callback for modern drivers"drivers/ include/ | +25 | 8 replies | |
| 6/24 | drm/lima: add lima uapi headerinclude/ | +195 | 4 replies | |
| 7/24 | drm/lima: add mali 4xx GPU hardware regsdrivers/ | +304 | 4 replies | |
| 8/24 | drm/lima: add lima core driverdrivers/ drivers/ | +543 | 0 replies | |
| 9/24 | drm/lima: add GPU device functionsdrivers/ drivers/ | +543 | 0 replies | |
| 10/24 | drm/lima: add PMU related functionsdrivers/ drivers/ | +115 | 0 replies | |
| 11/24 | drm/lima: add L2 cache functionsdrivers/ drivers/ | +130 | 0 replies | |
| 12/24 | drm/lima: add GP related functionsdrivers/ drivers/ | +327 | 2 replies | |
| 13/24 | drm/lima: add PP related functionsdrivers/ drivers/ | +455 | 0 replies | |
| 14/24 | drm/lima: add MMU related functionsdrivers/ drivers/ | +188 | 0 replies | |
| 15/24 | drm/lima: add BCAST related functiondrivers/ drivers/ | +99 | 0 replies | |
| 16/24 | drm/lima: add DLBU related functionsdrivers/ drivers/ | +112 | 0 replies | |
| 17/24 | drm/lima: add GPU virtual memory space handingdrivers/ drivers/ | +385 | 0 replies | |
| 18/24 | drm/lima: add TTM subsystem functionsdrivers/ drivers/ | +453 | 0 replies | |
| 19/24 | drm/lima: add buffer object functionsdrivers/ drivers/ | +207 | 0 replies | |
| 20/24 | drm/lima: add GEM related functionsdrivers/ drivers/ | +500 | 0 replies | |
| 21/24 | drm/lima: add GEM Prime related functionsdrivers/ drivers/ | +97 | 0 replies | |
| 22/24 | drm/lima: add GPU schedule using DRM_SCHEDdrivers/ drivers/ | +623 | 0 replies | |
| 23/24 | drm/lima: add context related functionsdrivers/ drivers/ | +194 | 0 replies | |
| 24/24 | drm/lima: add makefile and kconfigdrivers/ drivers/ drivers/ +1 more | +31 | 9 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH RFC 00/24] Lima DRM driver
Kernel DRM driver for ARM Mali 400/450 GPUs.
This implementation mainly take amdgpu DRM driver as reference.
- Mali 4xx GPUs have two kinds of processors GP and PP. GP is for OpenGL vertex shader processing and PP is for fragment shader processing. Each processor has its own MMU so prcessors work in virtual address space.
- There's only one GP but multiple PP (max 4 for mali 400 and 8 for mali 450) in the same mali 4xx GPU. All PPs are grouped togather to handle a single fragment shader task divided by FB output tiled pixels. Mali 400 user space driver is responsible for assign target tiled pixels to each PP, but mali 450 has a HW module called DLBU to dynamically balance each PP's load.
- User space driver allocate buffer object and map into GPU virtual address space, upload command stream and draw data with CPU mmap of the buffer object, then submit task to GP/PP with a register frame indicating where is the command stream and misc settings.
- There's no command stream validation/relocation due to each user process has its own GPU virtual address space. GP/PP's MMU switch virtual address space before running two tasks from different user process. Error or evil user space code just get MMU fault or GP/PP error IRQ, then the HW/SW will be recovered.
- Use TTM as MM. TTM_PL_TT type memory is used as the content of lima buffer object which is allocated from TTM page pool. all lima buffer object gets pinned with TTM_PL_FLAG_NO_EVICT when allocation, so there's no buffer eviction and swap for now. We need reverse engineering to see if and how GP/PP support MMU fault recovery (continue execution). Otherwise we have to pin/unpin each envolved buffer when task creation/deletion.
- Use drm_sched for GPU task schedule. Each OpenGL context should have a lima context object in the kernel to distinguish tasks from different user. drm_sched gets task from each lima context in a fair way.
Not implemented:
- Dump buffer support
- Power management
- Performance counter
This patch serial just pack a pair of .c/.h files in each patch. For whole history of this driver's development, see:
https://github.com/yuq/linux-lima/commits/lima-4.17-rc4
Mesa driver is still in development and not ready for daily usage, but can run some simple tests like kmscube and glamrk2, see:
https://github.com/yuq/mesa-lima
Andrei Paulau (1):
arm64/dts: add switch-delay for meson mali
Lima Project Developers (10):
drm/lima: add mali 4xx GPU hardware regs
drm/lima: add lima core driver
drm/lima: add GPU device functions
drm/lima: add PMU related functions
drm/lima: add PP related functions
drm/lima: add MMU related functions
drm/lima: add GPU virtual memory space handing
drm/lima: add GEM related functions
drm/lima: add GEM Prime related functions
drm/lima: add makefile and kconfig
Qiang Yu (12):
dt-bindings: add switch-delay property for mali-utgard arm64/dts: add switch-delay for meson mali
Revert "drm: Nerf the preclose callback for modern drivers" drm/lima: add lima uapi header
drm/lima: add L2 cache functions
drm/lima: add GP related functions
drm/lima: add BCAST related function
drm/lima: add DLBU related functions
drm/lima: add TTM subsystem functions
drm/lima: add buffer object functions
drm/lima: add GPU schedule using DRM_SCHED drm/lima: add context related functions
Simon Shields (1):
ARM: dts: add gpu node to exynos4
.../bindings/gpu/arm,mali-utgard.txt | 4 + arch/arm/boot/dts/exynos4.dtsi | 33 ++ arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 1 + .../boot/dts/amlogic/meson-gxl-mali.dtsi | 1 + drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/drm_file.c | 8 +- drivers/gpu/drm/lima/Kconfig | 9 + drivers/gpu/drm/lima/Makefile | 19 + drivers/gpu/drm/lima/lima_bcast.c | 65 +++ drivers/gpu/drm/lima/lima_bcast.h | 34 ++ drivers/gpu/drm/lima/lima_ctx.c | 143 +++++ drivers/gpu/drm/lima/lima_ctx.h | 51 ++ drivers/gpu/drm/lima/lima_device.c | 407 ++++++++++++++ drivers/gpu/drm/lima/lima_device.h | 136 +++++ drivers/gpu/drm/lima/lima_dlbu.c | 75 +++ drivers/gpu/drm/lima/lima_dlbu.h | 37 ++ drivers/gpu/drm/lima/lima_drv.c | 466 ++++++++++++++++ drivers/gpu/drm/lima/lima_drv.h | 77 +++ drivers/gpu/drm/lima/lima_gem.c | 459 ++++++++++++++++ drivers/gpu/drm/lima/lima_gem.h | 41 ++ drivers/gpu/drm/lima/lima_gem_prime.c | 66 +++ drivers/gpu/drm/lima/lima_gem_prime.h | 31 ++ drivers/gpu/drm/lima/lima_gp.c | 293 +++++++++++ drivers/gpu/drm/lima/lima_gp.h | 34 ++ drivers/gpu/drm/lima/lima_l2_cache.c | 98 ++++ drivers/gpu/drm/lima/lima_l2_cache.h | 32 ++ drivers/gpu/drm/lima/lima_mmu.c | 154 ++++++ drivers/gpu/drm/lima/lima_mmu.h | 34 ++ drivers/gpu/drm/lima/lima_object.c | 120 +++++ drivers/gpu/drm/lima/lima_object.h | 87 +++ drivers/gpu/drm/lima/lima_pmu.c | 85 +++ drivers/gpu/drm/lima/lima_pmu.h | 30 ++ drivers/gpu/drm/lima/lima_pp.c | 418 +++++++++++++++ drivers/gpu/drm/lima/lima_pp.h | 37 ++ drivers/gpu/drm/lima/lima_regs.h | 304 +++++++++++ drivers/gpu/drm/lima/lima_sched.c | 497 ++++++++++++++++++ drivers/gpu/drm/lima/lima_sched.h | 126 +++++ drivers/gpu/drm/lima/lima_ttm.c | 409 ++++++++++++++ drivers/gpu/drm/lima/lima_ttm.h | 44 ++ drivers/gpu/drm/lima/lima_vm.c | 312 +++++++++++ drivers/gpu/drm/lima/lima_vm.h | 73 +++ include/drm/drm_drv.h | 23 +- include/uapi/drm/lima_drm.h | 195 +++++++ 44 files changed, 5565 insertions(+), 6 deletions(-) create mode 100644 drivers/gpu/drm/lima/Kconfig create mode 100644 drivers/gpu/drm/lima/Makefile create mode 100644 drivers/gpu/drm/lima/lima_bcast.c create mode 100644 drivers/gpu/drm/lima/lima_bcast.h create mode 100644 drivers/gpu/drm/lima/lima_ctx.c create mode 100644 drivers/gpu/drm/lima/lima_ctx.h create mode 100644 drivers/gpu/drm/lima/lima_device.c create mode 100644 drivers/gpu/drm/lima/lima_device.h create mode 100644 drivers/gpu/drm/lima/lima_dlbu.c create mode 100644 drivers/gpu/drm/lima/lima_dlbu.h create mode 100644 drivers/gpu/drm/lima/lima_drv.c create mode 100644 drivers/gpu/drm/lima/lima_drv.h create mode 100644 drivers/gpu/drm/lima/lima_gem.c create mode 100644 drivers/gpu/drm/lima/lima_gem.h create mode 100644 drivers/gpu/drm/lima/lima_gem_prime.c create mode 100644 drivers/gpu/drm/lima/lima_gem_prime.h create mode 100644 drivers/gpu/drm/lima/lima_gp.c create mode 100644 drivers/gpu/drm/lima/lima_gp.h create mode 100644 drivers/gpu/drm/lima/lima_l2_cache.c create mode 100644 drivers/gpu/drm/lima/lima_l2_cache.h create mode 100644 drivers/gpu/drm/lima/lima_mmu.c create mode 100644 drivers/gpu/drm/lima/lima_mmu.h create mode 100644 drivers/gpu/drm/lima/lima_object.c create mode 100644 drivers/gpu/drm/lima/lima_object.h create mode 100644 drivers/gpu/drm/lima/lima_pmu.c create mode 100644 drivers/gpu/drm/lima/lima_pmu.h create mode 100644 drivers/gpu/drm/lima/lima_pp.c create mode 100644 drivers/gpu/drm/lima/lima_pp.h create mode 100644 drivers/gpu/drm/lima/lima_regs.h create mode 100644 drivers/gpu/drm/lima/lima_sched.c create mode 100644 drivers/gpu/drm/lima/lima_sched.h create mode 100644 drivers/gpu/drm/lima/lima_ttm.c create mode 100644 drivers/gpu/drm/lima/lima_ttm.h create mode 100644 drivers/gpu/drm/lima/lima_vm.c create mode 100644 drivers/gpu/drm/lima/lima_vm.h create mode 100644 include/uapi/drm/lima_drm.h
Signature · 6 lines
2.17.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel