Skip to content

Port Xe to use GPUVA and implement NULL VM binds

Matthew Brost intel-xe 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest8 patches 8 repliesIn review
  2. v16 patches 0 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8maple_tree: split up MA_STATE() macroinclude/linux/maple_tree.h+5 -20 replies
2/8maple_tree: Export mas_preallocatelib/maple_tree.c+1 -00 replies
3/8drm: manager to keep track of GPUs VA mappingsDocumentation/gpu/drm-mm.rst drivers/gpu/drm/Makefile drivers/gpu/drm/drm_debugfs.c +6 more+2821 -00 replies
4/8drm/xe: Port Xe to GPUVAdrivers/gpu/drm/xe/xe_bo.c drivers/gpu/drm/xe/xe_device.c drivers/gpu/drm/xe/xe_exec.c +10 more+1126 -11724 replies
5/8drm/xe: NULL binding implementationdrivers/gpu/drm/xe/xe_bo.h drivers/gpu/drm/xe/xe_exec.c drivers/gpu/drm/xe/xe_gt_pagefault.c +6 more+144 -550 replies
6/8drm/xe: Avoid doing rebindsdrivers/gpu/drm/xe/xe_pt.c drivers/gpu/drm/xe/xe_vm.c drivers/gpu/drm/xe/xe_vm_types.h+65 -250 replies
7/8drm/xe: Reduce the number list links in xe_vmadrivers/gpu/drm/xe/xe_gt_pagefault.c drivers/gpu/drm/xe/xe_pt.c drivers/gpu/drm/xe/xe_vm.c +1 more+55 -520 replies
8/8drm/xe: Optimize size of xe_vma allocationdrivers/gpu/drm/xe/xe_vm.c drivers/gpu/drm/xe/xe_vm_types.h+57 -450 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [Intel-xe] [PATCH v5 0/8] Port Xe to use GPUVA and implement NULL VM binds

GPUVA is common code written primarily by Danilo with the idea being a common place to track GPUVAs (VMAs in Xe) within an address space (VMs in Xe), track all the GPUVAs attached to GEMs, and a common way implement VM binds / unbinds with MMAP / MUNMAP semantics via creating operation lists. All of this adds up to a common way to implement VK sparse bindings.

This series pulls in the GPUVA code written by Danilo plus some small fixes by myself into 1 large patch. Once the GPUVA makes it upstream, we can rebase and drop this patch. I believe what lands upstream should be nearly identical to this patch at least from an API perspective.

The last three patches port Xe to GPUVA and add support for NULL VM binds (writes dropped, read zero, VK sparse support). An example of the semantics of this is below.

MAP 0x0000-0x8000 to NULL - 0x0000-0x8000 writes dropped + read zero
MAP 0x4000-0x5000 to a GEM - 0x0000-0x4000, 0x5000-0x8000 writes dropped + read zero; 0x4000-0x5000 mapped to a GEM
UNMAP 0x3000-0x6000 - 0x0000-0x3000, 0x6000-0x8000 writes dropped + read zero
UNMAP 0x0000-0x8000 - Nothing mapped

No changins to existing behavior, rather just new functionality./

v2: Fix CI build failure
v3: Export mas_preallocate, add patch to avoid rebinds
v5: Bug fixes, rebase, xe_vma size optimizations

Danilo Krummrich (2):
maple_tree: split up MA_STATE() macro
drm: manager to keep track of GPUs VA mappings

Matthew Brost (6):
maple_tree: Export mas_preallocate
drm/xe: Port Xe to GPUVA
drm/xe: NULL binding implementation
drm/xe: Avoid doing rebinds
drm/xe: Reduce the number list links in xe_vma
drm/xe: Optimize size of xe_vma allocation

 Documentation/gpu/drm-mm.rst                |   31 +
 drivers/gpu/drm/Makefile                    |    1 +
 drivers/gpu/drm/drm_debugfs.c               |   56 +
 drivers/gpu/drm/drm_gem.c                   |    3 +
 drivers/gpu/drm/drm_gpuva_mgr.c             | 1890 ++++++++++++++++++
 drivers/gpu/drm/xe/xe_bo.c                  |   10 +-
 drivers/gpu/drm/xe/xe_bo.h                  |    1 +
 drivers/gpu/drm/xe/xe_device.c              |    2 +-
 drivers/gpu/drm/xe/xe_exec.c                |    4 +-
 drivers/gpu/drm/xe/xe_gt_pagefault.c        |   29 +-
 drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c |   14 +-
 drivers/gpu/drm/xe/xe_guc_ct.c              |    6 +-
 drivers/gpu/drm/xe/xe_migrate.c             |    8 +-
 drivers/gpu/drm/xe/xe_pt.c                  |  176 +-
 drivers/gpu/drm/xe/xe_trace.h               |   10 +-
 drivers/gpu/drm/xe/xe_vm.c                  | 1947 +++++++++----------
 drivers/gpu/drm/xe/xe_vm.h                  |   76 +-
 drivers/gpu/drm/xe/xe_vm_madvise.c          |   87 +-
 drivers/gpu/drm/xe/xe_vm_types.h            |  276 ++-
 include/drm/drm_debugfs.h                   |   24 +
 include/drm/drm_drv.h                       |    7 +
 include/drm/drm_gem.h                       |   75 +
 include/drm/drm_gpuva_mgr.h                 |  734 +++++++
 include/linux/maple_tree.h                  |    7 +-
 include/uapi/drm/xe_drm.h                   |    8 +
 lib/maple_tree.c                            |    1 +
 26 files changed, 4203 insertions(+), 1280 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_gpuva_mgr.c
 create mode 100644 include/drm/drm_gpuva_mgr.h
Signature · 1 line
2.34.1