feat(agc): poll and write registers in PM4 COND_WRITE #16184
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16184"
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-05T20:20:16Z.
What
PM4
COND_WRITE(opcode 0x45) worked only with a memory poll and a memory destination. A register poll threwregister-space COND_WRITE poll is not implemented, and a register destination threwregister or scratch COND_WRITE destination is not implemented. This PR runs both for the registers the queue already models.Packet, from AMD's Southern Islands programming guide §2.7.2 (pp. 33–34) and PAL's GFX10 packet definition (lines 521–630, nine dwords):
POLL_SPACE(bit 4) selects register or memory, andWRITE_SPACE(bits 8–9) selects register, memory or scratch.SET_*_REGbuilders subtract (gfx9CmdUtil.cpplines 3650, 4025 and 4084) and Mesa'ssid.hdefines. Mesa'sac_cmdbuf.hconverts byte offsets to the same dword numbers.Change (
core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp):0x2c00–0x2fff), context (0xa000–0xa3ff) or user-config (0xc000–0xffff) register value, using the comparison code memory polls already use.SET_SH_REG,SET_CONTEXT_REGorSET_UCONFIG_REG, so a register's side effects apply. The test checks this withVGT_INDEX_TYPE(0xc243). It reports no guest memory store to capture or replay.docs/dev/debt/libSceAgcDriver.mdentry records what still throws and that PS5 behaviour, GFX10 high-dword handling and write confirmation are not measured.Tested
agc_driver_pm4(core/libs/prx/libSceAgcDriver/tests/Pm4.cpp) gainstestConditionalWriteRegisters. Every existing assertion is kept, including the existing rejections, whose register addresses are host pointers outside the modeled banks.SET_*_REGpackets followed by three register-pollCOND_WRITEs in one submission see the newly set values.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. The run covered the 18 PM4, replay, recorder and register-key tests (agc_driver_pm4*,agc_driver_pm4_replay*,agc_driver_recorder,agc_driver_register_key):mainpasses 18/18. With only the new test added,agc_driver_pm4fails withregister-space COND_WRITE poll is not implemented;VUID-lines and no missing-layer messages.COND_WRITE did not read back its register destination.e3c04eb545, with no skips. Windows registersagc_driver_pm4_ring_report_heapwhere Linux registersagc_driver_pm4_priority_refused;main'sPm4.cpp,agc_driver_pm4fails with the same message;VUID-lines and no missing-layer messages. The PM4 test creates no Vulkan instance; 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 feat/agc-cond-write-registers: no confirmed overlap.main. Trial merges of all 48 add no conflicted file, and the conflict contents stay the same except for #14212 (blank lines between debt entries), which also conflicts with the new entry.Pm4.cpp, #12568, #15136, #16054, #15610, #14330, #14130, #14110, #12944, #12567, #9893 and #6549 merge cleanly. #12315, #10249 and #6188 keep only the conflicts they already have withmain.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