fix(agc): don't let a queue worker record on a device the presenter is replacing #110
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/110"
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 oneandonlydean on 2026-09-28T23:56:17Z.
What
The presenter replaces the driver's device when the window first appears (the headless device has no surface). Queue workers don't hold
GpuMutexfor all of a packet: a dispatch's prologue loads the device atomically and records later. A worker could therefore capture the old device, lose the race with the presenter, and record onto a device thatPrepareForReplacementwas already tearing down. On Linux with NVIDIA, the next submission hung the GPU.DeviceUseGateis a small writer-preferring gate:Packets that wait on something the presenter may produce don't take the gate, so a waiting worker can't block the replacement it's waiting for. Those are WAIT_REG_MEM (0x3c), WAIT_REG_MEM64 (0x93), the rendering-wait packet and the flip.
Tested
ctest: 57/57 pass.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