fix(agc): accept GDS DMA_DATA register address controls #16345
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16345"
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 AlexWhitehouse on 2026-11-06T10:26:33Z.
What
A PM4
DMA_DATA(opcode 0x50) with a GDS endpoint was refused whenever that endpoint's address-control bits were set.dmaSource()anddmaDestination()incore/libs/prx/libSceAgcDriver/Execution/src/Pm4.cppfold SAS/SAIC (packet[6]bits 26 and 28) and DAS/DAIC (bits 27 and 29) into the selector. So GDS (selector 1) with both bits set became selector 13, and validation rejected it withDMA_DATA register source is not implementedorDMA_DATA register destination is not implemented.That is the encoding Mesa's radeonsi emits for every GDS DMA. Mesa 24.0.0
si_cp_dma.c, lines 72–86:DST_SEL(GDS) | DAS(REGISTER) | DAIC(NO_INCREMENT);SRC_SEL(GDS) | SAS(REGISTER) | SAIC(NO_INCREMENT);The bit positions match PAL's GFX9+ packet definition at c5e8000 (selectors, lines 1238–1249; address controls, lines 1285–1289) and Mesa's
pkt3.json.Change:
ResolveStore,DecodeStores, execution and capture therefore treat those packets as the consecutive GDS transfers the driver already performs with clear controls.DMA_DATAare not implemented here.docs/dev/debt/changes/fix-agc-dma-data-gds-address-controls.md, adds alibSceAgcDriverentry that records the accepted encodings, the Mesa source, that PS5 is not measured, and what still throws.Tested
testDmaGdsAddressControlsincore/libs/prx/libSceAgcDriver/tests/Pm4.cpp(ctestagc_driver_pm4). Existing assertions are unchanged, andtestCopiesis untouched.Validate,ResolveStoreandDecodeStoresgive the same result as the clear-control GDS packet, and a GDS destination reports no guest memory store.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, over the 18 tests matchingagc_driver_pm4|agc_driver_recorder|agc_driver_register_key:mainpasses 18/18. With only the new test added,agc_driver_pm4fails withDMA_DATA register destination is not implemented; a source-only variant fails withDMA_DATA register source is not implemented;VUID-lines and no missing-layer messages.DMA_DATA register source is not implemented.agc_driver_pm4_ring_report_heapwhere Linux registersagc_driver_pm4_priority_refused;main'sPm4.cpp,agc_driver_pm4fails withDMA_DATA register destination is not implemented;VUID-lines and no missing-layer messages. AVK_LOADER_DEBUG=layerrerun ofagc_driver_recorderconfirmed that the validation layer was inserted at instance and device level.python3 tools/check_conventions.py --base origin/main: all conventions checks passed.python3 tools/pr_overlap.py --branch fix/agc-dma-data-gds-address-controls: no confirmed overlap.main.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-11-06T16:53:58Z.
Review: COMMENTED
Checked that the normalisation reaches every consumer on
main. Nothing reads the SAS/SAIC/DAS/DAIC bits outsidedmaSource/dmaDestination. The users of the selectors all go throughPm4::DmaSource/Pm4::DmaDestination:DMA_DATAinPacketExecution.cpp(the GDS source range againstDrawPipeline::Queue0());PacketMemory.cpp(gdsDestination,gdsWritesPending, the store-limit split);describeDmaEndintools/Pm4Analysis.cpp.So a controlled GDS endpoint takes the same paths as a plain one everywhere, not just in validation. The refusal loop in the test covers the other 11 selector and control combinations.
testDmaGdsAddressControlsis CPU-only, so a GPU run adds nothing beyond the CI result above.AI-assisted: yes (Claude Code)