Skip to content

drm/xe: dma-buf fixes.

Thomas Hellström requested to merge thomash/kernel:dma_buf_fixes into xe

Fix up the dma-buf code that was broken, at least when importing dma-bufs from different drivers.

For the dynamic functionality, evicting a ttm sg-type bo (which was previously disallowed) now means we trigger a rebind and a new call to dma_buf_map_attachment(). These are currently deferred though. We also add the possibility to migrate a bo on map_attachment() and pin() time to take into account importers that don't support p2p functionality.

Two last patches deal with adding Kunit selftest functionality and hooking up a dma-buf selftest. We have three levels of selftests {live/mock/perf (only live implemented)} / unit to test (dma-buf, migration etc) / subtest. However AFAICT kunit only supports two (suite and case). We initially take a similar approach as i915 and group multiple subtests as a single case. This might not be the best approach, though. Comments appreciated. The resulting test suite module can be inserted (and tests run) at any time while the xe device is alive. The struct task struct kunit_test->priv parameters helps with this to avoid static selftest state.

v3:

  • Fixed empty xe_bo_free() (Matthew Brost)
  • Removed the export dma-buf test (Matthew Brost)
  • Added a call to move_notify when moving dma-bufs. Needed primarily for dma-buf eviction.
  • Same test structure as for the drm Kunit tests.
Edited by Thomas Hellström

Merge request reports