feat(agc): import shared ranges whose backing offset is not 64 KiB aligned #5390
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5390"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-13T18:36:33Z.
What
Follow-up to #5309. A sparse buffer binds whole blocks (64 KiB on RADV), so #5309 takes the sparse path only for a shared range whose offset in the memfd is a multiple of the block size, and decides that before importing. Any other range larger than 64 MiB still goes to one
UDMABUF_CREATE, which udmabuf refuses above its defaultsize_limit_mbof 64, and is copied. ASTRO BOT (PPSA21567) has several such ranges with #5309, including a heap that is made again with each new allocation:Each starts on a 16 KiB page, not on a 64 KiB block.
This PR starts the sparse buffer at the 64 KiB block below the range, inside #5309's decision:
createSparseDmaBufImporttakeslead = offset % 64 KiBoff the backing offset before deciding, and sizes the sparse bufferlead + bytes. The decision is otherwise #5309's: a device whose sparse block size is larger than 64 KiB still declines before anything is imported, and failures after the decision still throw;HostImport::leadis the distance from the start of the buffer tobase(0 for every other import);entry.addressis the device address ofbaseitself, so address-based (BDA) users are unchanged;HostImportOffset(import, address)(address - base + lead), instead ofaddress - import->base: fills, copies, label stores, indirect arguments and counts, index and vertex inputs, detile offsets, the storage write-back's copies into each import segment, unit-shadow sources and seeds, DCC key stores, the in-place view binding and itscopySourceBase;begin - importBase + importLead.The leading bytes of the buffer belong to the memfd but are never addressed.
Measured
ASTRO BOT, RX 9070 XT (RADV),
size_limit_mbleft at its default of 64, 60 s from launch with no input,APS5_TRACE_HOST_IMPORT=1:main(4224d240a), 1 run107538d89andad572ebb1, 2 runs each)UDMABUF_CREATE)Measured earlier on the title screen against #5309's first head, per 10 s: image mirror refreshes dropped from 26,049 (914,912 blocks copied) to 6,623 (262,595), and guest memory reads from 9.4 GB to 3.2 GB with
APS5_HOST_IMPORT_MIB=16384. The frame rate did not change (~20 FPS): the title screen is bound by GPU time and draw recording, not by these copies.Tested
agc_pending_key_storesandagc_driver_tessellation, which fail the same way onmain(4224d240a), andagc_host_import_sparse, which needs #5759 (merged since; below).agc_host_import_sparsechanges its unaligned case: a range 4 KiB into the memfd is now imported, withlead4 KiB, the device address of the range itself, and its first bind at the block below it. A new case keeps the decision check: with a mocked sparse block of 128 KiB, a range 64 KiB into the memfd imports and binds no chunk.agc_driver_sparse_dma_buf_importregisters a range 16 KiB into the memfd, larger than the currentsize_limit_mb, and fills 64 KiB across the first chunk boundary through the import by guest address, checking the backing memory at that address and the bytes on both sides. It then publishes a unit shadow of that import and checks the unit's guest bytes and the 16 KiB on each side; without the lead in the publish it fails there.agc_driver_sparse_dma_buf_importtherefore checks the lead only for a dma-buf import (d7018a53a, after @nicolasfalesy's report). On lavapipe (Mesa 26.2.4,/dev/udmabufwritable) it failed 2 of 2 runs before that commit and passes 3 of 3 after it, with a note that the import went through a host pointer; on RADV it passes 3 of 3 with the lead checked. The 21 tests matching^agc.*(import|dma|sparse|shadow|unit)give the same result on both devices: 19 pass,agc_shadowed_key_storesskips, andagc_host_import_sparsefails without #5759.4224d240a), the test'sSharedRangeleaves dangling pointers inbackings, which can make any case after the first resolve the wrong backing. #5759 fixes that and is merged now. With its change applied to this branch,agc_host_import_sparsepassed 8 of 8 runs before, and 4 of 4 on the current head, both on RADV and under lavapipe (the test mocks the device).audio_out2_shutdown,audio_out_shutdownandguest_kqueue(0xc0000409) out of 1288, the same three asmain(4224d240a) on the same VM. The GPU tests skip in this VM, and the sparse tests skip there since udmabuf imports are Linux only.lead0, runs as before. Hades (PPSA03355) stops at ~9 s as onmain(#5905).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)agc_host_import_sparseneeds, is merged)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T08:59:41Z.
#5309 is in, and it changes the path this PR builds on: the sparse path is now decided before any import, and failures after that throw instead of falling back. Could you rebase and redo the unaligned-offset handling on top of it? The old 00053abd5 commit no longer fits.
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-14T10:55:48Z.
Rebased onto
mainand redone on top of #5309's decision.createSparseDmaBufImporttakes the 64 KiB lead off the backing offset before deciding and sizes the sparse bufferlead + bytes. The rest of the decision and the throws after it are unchanged. Inagc_host_import_sparse, the unaligned case now expects the import (lead, device address of the range, first bind at the block below). A new case keeps the decide-before-importing check with a mocked 128 KiB sparse block. ASTRO BOT at the defaultsize_limit_mb: 23 fallbacks to copies with #5309 alone, none with this PR. The test fixture needs #5759, so it is listed under Depends on. Description updated.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:07:40Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppL4181core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppL4181core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppL4626core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppL2880-2881core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppL513core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppL42Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppdocs/dev/debt/libSceAgcDriver.mddocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppdocs/user/USAGE.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppdocs/dev/debt/libSceAgcDriver.mddocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/UnitShadow.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/tests/HostImportSparseDmaBuf.cppcore/libs/prx/libSceAgcDriver/tests/execution/SparseDmaBufImport.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/user/USAGE.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/UnitShadow.cppdocs/dev/debt/libSceAgcDriver.mddocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/UnitShadow.cppdocs/dev/debt/libSceAgcDriver.mddocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/tests/HostImportSparseDmaBuf.cppcore/libs/prx/libSceAgcDriver/tests/execution/SparseDmaBufImport.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/tests/HostImportSparseDmaBuf.cppcore/libs/prx/libSceAgcDriver/tests/execution/SparseDmaBufImport.cppdocs/dev/debt/libSceAgcDriver.mddocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppImported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-15T14:22:55Z.
Rebased onto
main(4224d240a) again, in two commits:main.Texture.cppconflicted:mainnow writes a storage image back through each import segment it spans, and the new copy offset into a segment's import (begin - segment.import->base) goes throughHostImportOffsetas well.begin - shadow->importBase, without the import's lead. A unit shadow of an unaligned import would have been publishedleadbytes early, over the guest bytes before the unit. The shadow now keeps the lead, andagc_driver_sparse_dma_buf_importpublishes a unit shadow of its unaligned import and checks the unit and the 16 KiB on each side. Without the fix it fails there.The description has the new numbers: ASTRO BOT on
mainstill falls back to copies 20 times (8 ranges above 64 MiB), and not at all with this PR.Imported from boykopovar/AnyPS5. Originally posted by nicolasfalesy on 2026-10-16T08:53:00Z.
Tested on Linux (Arch),
c++ (GCC) 16.2.1 20260810, Release,BUILD_TESTING=ON,mainat5d9dcc42d2ec5401aebd089028b8d4d7410a77b4. GPU tests ran on lavapipe (Mesa 26.2.2, llvmpipe with LLVM 22.1.8).agc_driver_sparse_dma_buf_importpasses onmain(2 of 2) and fails onmainplus this PR (2 of 2):That is the check at
SparseDmaBufImport.cpp:188of this PR. I printed the values:HostImportForreturns an import, but itsleadis 0 where the test expects 16384. The test is skipped on Windows (#ifdef _WIN32), so only Linux runs it. The dma-buf import for the range at a 16 KiB offset does not carry the lead on lavapipe. The same assertion also failed in a combined build on an Intel Arc B390.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-16T11:24:17Z.
Thanks for running it and printing the values, that pinned it down.
createImporttries a host-pointer import first and uses dma-buf only when that fails. RADV refuses a host-pointer import of the shared memfd mapping, so the unaligned range goes to the sparse dma-buf import, with its lead. lavapipe accepts it, so the range is imported through a host pointer, whose buffer starts at the range:leadis 0 and this PR's path is not taken at all. The test assumed a dma-buf import.d7018a53a checks the lead only for a dma-buf import (
HostImport::dmaBuf) and prints a note otherwise. With lavapipe from Mesa 26.2.4 on my machine (/dev/udmabufwritable), the test failed 2 of 2 runs before that commit, with your message, and passes 3 of 3 after it, with the note that the import went through a host pointer. On RADV it passes 3 of 3 with the lead checked. The other 20 tests matching^agc.*(import|dma|sparse|shadow|unit)give the same results on both devices.The Intel Arc B390 failure is probably the same, if ANV takes the host-pointer import there. I could not check that here; on that machine the note in the output would say which path the import took.
On a Linux host with
/dev/udmabuf,agc_host_import_sparsealso fails on this branch's base, because it needs #5759, which is merged now. The description has the numbers.Imported from boykopovar/AnyPS5. Originally posted by nicolasfalesy on 2026-10-16T11:53:57Z.
Checked
d7018a53aon the Intel Arc B390 from my earlier comment. Linux (Arch), Mesa 26.2.2 (ANV),/dev/udmabufwritable,c++ (GCC) 16.2.1 20260810, Release, merged onto currentmain(c8044c3a7) together with #6784, becausemaindoesn't build on Linux without it right now.agc_driver_sparse_dma_buf_importandagc_host_import_sparseboth pass, 2 of 2 runs. ANV takes the host-pointer path, as you guessed:AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T00:41:47Z.
The ANV run explains the lavapipe failure: both devices take the host-pointer path, where the lead is 0, so checking the lead only for a dma-buf import in
d7018a53ais right. The dma-buf path with its lead has still not run on a device that picks it, such as RADV. @hugodearaujo, it also conflicts with main again; please rebase, and say if anyone has run it on RADV.Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-17T18:12:17Z.
@oneandonlydean rebased onto
main(07b465114) asef622e2f8,9eb7e2444and52c4589f8. The only conflict was indocs/dev/debt/libSceAgcDriver.md, wheremain's new "Settled dma-buf imports" item (#5905) sits next to this PR's "Sparse dma-buf imports" item; both are kept.Run on RADV: AMD Radeon RX 9070 XT, Mesa 26.2.4, Arch Linux,
/dev/udmabufwritable,size_limit_mb64.agc_driver_sparse_dma_buf_importpasses 3 of 3 with no note, so the lead and the unit-shadow publish were both checked. With a print added locally next to the lead check (not in the branch), the unaligned range is a dma-buf import with lead 16384, andHostImportOffsetof the range's address is 16384:agc_host_import_sparsepasses 3 of 3 (it needed #5759, now inmain). Of the 21 tests matching^agc.*(import|dma|sparse|shadow|unit), 20 pass andagc_shadowed_key_storesskips.-j8: 1363 of 1364 pass;agc_driver_tessellationsegfaults, as it does onmainon this GPU.The "on RADV it passes 3 of 3 with the lead checked" in my earlier comment was this same device, but without printing the path. Windows was not rerun after the rebase; the sparse tests are Linux only.
AI-assisted: yes