Skip to content

drm/i915/gem: dma-buf fixes for migration

Thomas Hellström dri-devel intel-gfx 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2drm/i915/gem: Make our dma-buf exporter dynamicdrivers/gpu/drm/i915/gem/i915_gem_dmabuf.c drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c+143 -43 replies
2/2drm/i915/gem: Migrate to system at dma-buf map timedrivers/gpu/drm/i915/gem/i915_gem_dmabuf.c drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c+22 -30 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchMichael J. Ruhl
1/2
2/2R-b

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

Read the v1 thread

Cover letter [PATCH 0/2] drm/i915/gem: dma-buf fixes for migration

Our dma-buf code is currently completely broken unless the importer is dynamic in which case the sg_list caching saves the day. In particular, the case where another instance of our driver tries to import a dma-buf exported by our driver ends up in a recursive lock.

Since the recent TTM migration work spec specifies to fix up the dma-buf code with migration and there's no point in doing so when it's completely broken, take a first step to make at least the exporter obey the dma-buf locking rules the dma-buf core enforces for a dynamic exporter:

- Implement and act on pin- and unpin.
- Call move_notify if migrating. (we opt not to migrate while dma-buf_mapped).
- map_dma_buf() is unconditionally called locked.

Add a selftest that ensures that it works with both our own and a fake dynamic importer.

Also implement migration in the second patch before pinning in pin() and map_dma_buf().

Note that the importer remains broken for other non-dynamic exporters, but at least not for the same-driver-separate-instances case.

Regardless whether we want to fix this now with this series, or in an unspecified future, the selftest may come in handy.

Thomas Hellström (2):
drm/i915/gem: Make our dma-buf exporter dynamic drm/i915/gem: Migrate to system at dma-buf map time

 drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c    |  48 ++++++-
 .../drm/i915/gem/selftests/i915_gem_dmabuf.c  | 118 +++++++++++++++++-
 2 files changed, 162 insertions(+), 4 deletions(-)
Signature · 6 lines
2.31.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx