Skip to content

drm/i915/ttm: Async migration

Thomas Hellström dri-devel intel-gfx 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest6 patches 3 repliesIn review
  2. v66 patches 2 repliesSuperseded
  3. v56 patches 0 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v46 patches5 repliesSuperseded
v36 patches11 repliesSuperseded
v26 patches0 repliesSuperseded
v16 patches0 repliesSuperseded

v2 from the cover letter

- Fix a couple of SPARSE warnings.

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6drm/i915: Add support for moving fence waitingdrivers/gpu/drm/i915/gem/i915_gem_object.c drivers/gpu/drm/i915/gem/i915_gem_object.h drivers/gpu/drm/i915/gem/i915_gem_pages.c +1 more+106 -10 replies
2/6drm/i915/ttm: Move the i915_gem_obj_copy_ttm() functiondrivers/gpu/drm/i915/gem/i915_gem_ttm.c drivers/gpu/drm/i915/gem/i915_gem_ttm.h drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c +2 more+56 -690 replies
3/6drm/i915/ttm: Drop region reference countingdrivers/gpu/drm/i915/gem/i915_gem_region.c drivers/gpu/drm/i915/gem/i915_gem_shmem.c drivers/gpu/drm/i915/gem/i915_gem_stolen.c +9 more+69 -460 replies
4/6drm/i915/ttm: Correctly handle waiting for gpu when shrinkingdrivers/gpu/drm/i915/gem/i915_gem_object_types.h drivers/gpu/drm/i915/gem/i915_gem_shrinker.c drivers/gpu/drm/i915/gem/i915_gem_ttm.c+8 -10 replies
5/6drm/i915/ttm: Implement asynchronous TTM movesdrivers/gpu/drm/i915/gem/i915_gem_ttm.c drivers/gpu/drm/i915/gem/i915_gem_ttm.h drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c +1 more+348 -320 replies
6/6drm/i915/ttm: Update i915_gem_obj_copy_ttm() to be asynchronousdrivers/gpu/drm/i915/gem/i915_gem_ttm_move.c drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c+30 -120 replies

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchMatthew Auld
1/6R-b
2/6R-b
3/6R-b
4/6R-b
5/6R-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [PATCH v7 0/6] drm/i915/ttm: Async migration

This patch series deals with async migration and async vram management. It still leaves an important part out, which is async unbinding which will reduce latency further, at least when trying to migrate already active objects.

Patch 1/6 deals with accessing and waiting for the TTM moving fence from i915 GEM.
Patch 2 is pure code reorganization, no functional change. Patch 3 breaks a refcounting loop involving the TTM moving fence. Patch 4 makes the i915 TTM shinking code handle async moves. Patch 5 uses TTM to implement the ttm move() callback async, it also introduces a utility to collect dependencies and turn them into a single dma_fence, which is needed for the intel_migrate code. This also affects the gem object migrate code.
Patch 6 makes the object copy utility async as well, mainly for future users since the only current user, suspend backup and restore, typically will want to sync anyway.

v2:
- Fix a couple of SPARSE warnings.
v3:
- Fix a NULL pointer dereference.
v4:
- Squash what was previously patch 1 and 2 to patch1
- Ditch the moving fence waiting in i915_vma_pin_iomap()
- Rework how the refcounting loop is broken in patch 3. Drop region reference counting.
- Break what is now patch 4 out of patch 5. Add support for avoiding waiting for gpu when shrinking.
- A number of changes in patch 5. See the commit message for details. v5:
- Some fixes to i915_vma_verify_bind_complete() (Matthew Auld)
- Update patches with R-B.
v6:
- Code comment update
- Re-check for fence signaled before returning -EBUSY (Matthew Auld)
- Use dma_resv_iter_is_exclusive() (Matthew Auld)
- Await all dma-resv fences before a migration blit (Matthew Auld) v7:
- Fix yet another compilation failure in patch 1.

Maarten Lankhorst (1):
drm/i915: Add support for moving fence waiting

Thomas Hellström (5):
drm/i915/ttm: Move the i915_gem_obj_copy_ttm() function drm/i915/ttm: Drop region reference counting drm/i915/ttm: Correctly handle waiting for gpu when shrinking drm/i915/ttm: Implement asynchronous TTM moves drm/i915/ttm: Update i915_gem_obj_copy_ttm() to be asynchronous

 drivers/gpu/drm/i915/gem/i915_gem_object.c    |  52 +++
 drivers/gpu/drm/i915/gem/i915_gem_object.h    |   6 +
 .../gpu/drm/i915/gem/i915_gem_object_types.h  |   1 +
 drivers/gpu/drm/i915/gem/i915_gem_pages.c     |   6 +
 drivers/gpu/drm/i915/gem/i915_gem_region.c    |   4 +-
 drivers/gpu/drm/i915/gem/i915_gem_shmem.c     |   3 +-
 drivers/gpu/drm/i915/gem/i915_gem_shrinker.c  |   1 +
 drivers/gpu/drm/i915/gem/i915_gem_stolen.c    |   6 +-
 drivers/gpu/drm/i915/gem/i915_gem_ttm.c       |  89 ++--
 drivers/gpu/drm/i915/gem/i915_gem_ttm.h       |   6 +-
 drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c  | 409 ++++++++++++++++--
 drivers/gpu/drm/i915/gem/i915_gem_ttm_move.h  |  10 +-
 drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c    |   3 +
 drivers/gpu/drm/i915/gem/i915_gem_wait.c      |   4 +-
 .../gpu/drm/i915/gem/selftests/huge_pages.c   |   2 +-
 drivers/gpu/drm/i915/gt/intel_region_lmem.c   |  10 +-
 drivers/gpu/drm/i915/i915_vma.c               |  43 +-
 drivers/gpu/drm/i915/intel_memory_region.c    |  26 +-
 drivers/gpu/drm/i915/intel_memory_region.h    |   9 +-
 drivers/gpu/drm/i915/intel_region_ttm.c       |  35 +-
 drivers/gpu/drm/i915/intel_region_ttm.h       |   2 +-
 .../drm/i915/selftests/intel_memory_region.c  |   8 +-
 drivers/gpu/drm/i915/selftests/mock_region.c  |   7 +-
 23 files changed, 599 insertions(+), 143 deletions(-)
Signature · 1 line
2.31.1