Skip to content

drm/i915/gem: Introduce a migrate interface

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 2 repliesIn review
  2. v43 patches 1 replySuperseded
  3. v35 patches 19 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v25 patches1 replySuperseded
v14 patches10 repliesSuperseded

Changes in v5 from the cover letter

- Re-add might_sleep() annotation to i915_gem_object_wait_migration()
- Added R-B.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3drm/i915/gem: Implement object migrationdrivers/gpu/drm/i915/gem/i915_gem_object.c drivers/gpu/drm/i915/gem/i915_gem_object.h drivers/gpu/drm/i915/gem/i915_gem_object_types.h +2 more+217 -122 replies
2/3drm/i915/gem: Introduce a selftest for the gem object migrate functionalitydrivers/gpu/drm/i915/gem/i915_gem_object.c drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c drivers/gpu/drm/i915/selftests/i915_live_selftests.h+260 -00 replies
3/3drm/i915/display: Migrate objects to LMEM if possible for displaydrivers/gpu/drm/i915/display/intel_display.c drivers/gpu/drm/i915/gem/i915_gem_domain.c drivers/gpu/drm/i915/gem/i915_gem_lmem.c +1 more+5 -250 replies

Reviews trailers per patch

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

PatchMichael J. RuhlMatthew Auld
1/3R-b R-b
2/3R-b
3/3R-b

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

Read the v5 thread

Cover letter [PATCH v5 0/3] drm/i915/gem: Introduce a migrate interface

We want to be able to explicitly migrate objects between gem memory regions, initially for display and dma-buf, but there might be more use-cases coming up.

Introduce a gem migrate interface, add a selftest and use it for display fb pinning and dma-buf mapping.

This series should make accelerated desktop work on DG1 with DG1-enabled OpenGL.

v2:
- Address review comments by Matthew Auld on patch 1/5. More details on the patch commit message.
- Address a dma-buf locking issue pointed out by Michael Ruhl, and add a selftest to catch that issue moving forward.
- Rebase the dma-buf migration patch on the above-mentioned fix.

v3:
- Fix i915_gem_object_can_migrate() to return true if object is already in the correct region, even if the object ops doesn't have a migrate() callback.
- Update typo in commit message.

v4:
- Ditch dma-buf patches for now.
- Improve documentation (Suggested by Mattew Auld and Michael Ruhl)
- Always assume TTM migration hits a TTM move and unsets the pages through move_notify. (Reported by Matthew Auld)
- Add a dma_fence_might_wait() annotation to i915_gem_object_wait_migration() (Suggested by Daniel Vetter)
- Selftest updates (See specifics on that patch).
- Added R-Bs
v5:
- Re-add might_sleep() annotation to i915_gem_object_wait_migration()
- Added R-B.

Matthew Auld (1):
drm/i915/gem: Introduce a selftest for the gem object migrate
functionality

Thomas Hellström (2):
drm/i915/gem: Implement object migration drm/i915/display: Migrate objects to LMEM if possible for display

 drivers/gpu/drm/i915/display/intel_display.c  |   5 +-
 drivers/gpu/drm/i915/gem/i915_gem_domain.c    |   2 +-
 drivers/gpu/drm/i915/gem/i915_gem_lmem.c      |  21 --
 drivers/gpu/drm/i915/gem/i915_gem_object.c    | 113 ++++++++
 drivers/gpu/drm/i915/gem/i915_gem_object.h    |  12 +-
 .../gpu/drm/i915/gem/i915_gem_object_types.h  |   9 +
 drivers/gpu/drm/i915/gem/i915_gem_ttm.c       |  77 +++++-
 drivers/gpu/drm/i915/gem/i915_gem_wait.c      |  19 ++
 .../drm/i915/gem/selftests/i915_gem_migrate.c | 258 ++++++++++++++++++
 .../drm/i915/selftests/i915_live_selftests.h  |   1 +
 10 files changed, 481 insertions(+), 36 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c
Signature · 1 line
2.31.1