Files
metal2vulkan/docs
Anees Iqbal 97da82174b RUNTIME 2414: WorkCounts times the device's dma-buf imports and pieces' joins
The consumer asked for the time its dma-buf import calls take: each
vkGetMemoryFdPropertiesKHR and vkAllocateMemory of a dma-buf import, and
each piece's join of a live shared import.

Three new WorkCounts fields:
- dma_buf_import_calls: imports of dma-bufs of host pages tried, made or
  failed, wherever made (buffers', heaps', rebinds' chunks, shared files'
  imports at a first piece, ahead by a handle or again after the
  residency released them, guest RAM chunks and run lists, images).
- dma_buf_import_nanos: their nanoseconds, on the threads that made them.
- dma_buf_join_nanos: the nanoseconds of the joins dma_buf_pieces_joined
  counts (a map look and a hold, no driver call).

Every import goes through one timed helper (Device::import_timed) that
queries the dma-buf's types and imports it; the four call sites (a
chunk of its own, a shared file, the two image imports) use it.

Verified: the shared-file tests assert one timed import and a positive
join time for four buffers over one file, and four timed imports with
no join time for four dma-bufs of their own.

Why: the consumer's ask (reims dmabufapi): their A/Bs could not report the time the dma-buf import
calls take from WorkCounts.

Verified in the lane (m3-max-34812, msi): clippy -D warnings -p metal2vulkan-runtime --all-targets
--all-features; api_signatures 3/3; lavapipe -E 'test(/dma_buf/)' 73/73: four buffers over one shared
file count import calls 1 with nanos > 0 and 3 joins with join nanos > 0; the control (four dma-bufs of
their own) counts import calls 4 and join nanos 0. Still running when landed: clippy m2v_gpu and
m2v_cpu_icd, the PHOENIX dma-buf suite.

API: adds the fields WorkCounts::dma_buf_import_calls, dma_buf_import_nanos and dma_buf_join_nanos (additive).
2026-11-15 19:58:43 -08:00
..