All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 0/2] drm/i915/gem: dma-buf fixes for migration
@ 2021-06-30 13:06 ` Thomas Hellström
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Hellström @ 2021-06-30 13:06 UTC (permalink / raw)
  To: intel-gfx, dri-devel; +Cc: Thomas Hellström, matthew.auld

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(-)

-- 
2.31.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-06-30 18:15 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-30 13:06 [Intel-gfx] [PATCH 0/2] drm/i915/gem: dma-buf fixes for migration Thomas Hellström
2021-06-30 13:06 ` Thomas Hellström
2021-06-30 13:07 ` [Intel-gfx] [PATCH 1/2] drm/i915/gem: Make our dma-buf exporter dynamic Thomas Hellström
2021-06-30 13:07   ` Thomas Hellström
2021-06-30 14:01   ` [Intel-gfx] " Daniel Vetter
2021-06-30 14:01     ` Daniel Vetter
2021-06-30 14:06     ` [Intel-gfx] " Ruhl, Michael J
2021-06-30 14:06       ` Ruhl, Michael J
2021-06-30 17:14     ` [Intel-gfx] " Daniel Vetter
2021-06-30 17:14       ` Daniel Vetter
2021-06-30 13:07 ` [Intel-gfx] [PATCH 2/2] drm/i915/gem: Migrate to system at dma-buf map time Thomas Hellström
2021-06-30 13:07   ` Thomas Hellström
2021-06-30 17:46 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gem: dma-buf fixes for migration Patchwork
2021-06-30 18:15 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.