RUNTIME_VERSION 1938: a dma-buf export's texture goes in place through its own dma-buf where no image binds in the memory

Picks exitcrash's steelbrain/exitcrash-dmabuf (5e89357f00..617becef4f; the code is c2e90e2321).
Since RT 1930 (f46f1ca9cf), an image over exported memory names the memory's handle type
(VUID-02728). On RADV that left the dma-buf planes as announced shadows: the format query refuses
a plain linear image with DMA_BUF, and the DRM_FORMAT_MOD_LINEAR image needs a dedicated
allocation. The DMA_BUF | OPAQUE_FD export tried in between (1acb4f1fbf, 239d8ff9bb) hit
VUID-VkExportMemoryAllocateInfo-handleTypes-09860 at bind under the layer, so af8bda811b reverts
it, fix-forward.

What happens now:
- As the last step before the shadow, ungated by driver, only after a refusal, a texture over a
  runtime dma-buf export makes a DRM_FORMAT_MOD_LINEAR image. Its explicit plane lies at the
  texels' offset, with Metal's pitch.
- The image is bound to a dedicated import of vkGetMemoryFdKHR(DMA_BUF) of the buffer's memory,
  in that memory's own type, and acquired from FOREIGN_EXT, as the DmaBuf class's images are.
- The in-place check's ExportedDmaBuf textures take this exact route (CHECK_VERSION 14).
- The import is freed after the image. It is counted live, and WorkCounts::exported_dma_buf_images
  counts the images. The consumer's fd and export set are unchanged (DMA_BUF alone).
- Devices whose images bind in the memory (ANV, lavapipe) keep that path. The RX 550 lists no
  VK_EXT_image_drm_format_modifier, so its planes stay announced shadows (HOWTO section 7).

Verified, all at c2e90e2321 under the validation layer:
- 780M (m3-max-10369, RADV PHOENIX): 49/49, no VUID. Both NV12 planes are in place through the
  import in both storage modes: R8 at 256, RG8 at 8294656, row pitch 3840. 2 images were counted
  and 2 imports live, back to baseline once the textures dropped. The exported fd is a dma-buf
  (exp_name).
- RX 550 (m3-max-10372): 49/49, no VUID; announced shadows, 0 imports.
- lavapipe and Iris (m3-max-10370): 49/49 each, no VUID; planes in the memory, 0 imports.
- clippy clean (no cfg, m2v_gpu, m2v_cpu_icd); api_signatures and api_surface 15/15
  (m3-max-10412).
- Negative control (m3-max-10376): development 1c2f265ca6 plus the new test fails on the 780M,
  where the R8 plane is Shadow(Unchecked).
This commit is contained in:
Anees Iqbal committed 2026-11-08 18:31:24 -08:00
1 parent e22f367533
commit e9d1d94f36
2 files changed
+2 -2

No files matched your search

@@ -1 +1 @@
887c364811236683884681d6b8bca2eeaac41cb29665d474dd082ea69830ff80
4cec0dc33806fea4605b6eea7fffb76df6e4e7553dabc17dc96b7ea6073b98da
+1 -1
View File
@@ -93,7 +93,7 @@ pub const ARTIFACT_FORMAT_VERSION: u32 = 494;
/// changes no behaviour, and then updates that hash alone with the commit saying why, or changes
/// behaviour and also bumps this version. The commit that bumps it says what changed; this comment
/// keeps no history.
pub const RUNTIME_VERSION: u32 = 1937;
pub const RUNTIME_VERSION: u32 = 1938;
/// The digest of the sources this build of the crate was compiled from: SHA-256, as lowercase hex,
/// of the manifest, the build script, and exactly the files the crate roots' module tree compiles