fix(libSceAgcDriver): do not raise an interrupt for RELEASE_MEM send-data-after-write-confirm #1362

Merged
gjonn merged 1 commit from upstream-pr/1362 into main 2026-10-08 09:36:24 +00:00
gjonn commented 2026-10-08 00:19:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gjonn on 2026-10-08T00:19:57Z.


What

The packet executor raised an end-of-pipe interrupt for every RELEASE_MEM whose INT_SEL field (bits 24-26 of DW2) was non-zero. INT_SEL 3 is send_data_after_write_confirm: the data write waits for write confirmation and no interrupt is sent (values 1 and 2 send an interrupt; Mesa uses 3 for its ordinary fence writes). It no longer raises an interrupt for INT_SEL 3.

A title submits a DCB per frame with two RELEASE_MEM timestamp writes (DATA_SEL 3, INT_SEL 3) and one interrupt (INT_SEL 1). Its event thread takes the pending submission when a graphics end-of-pipe event arrives and clears it; the two extra events made it dereference a null pending submission (read of 0x48) right after start-up.

Tested

  • Windows 11, MinGW-w64 GCC 15.2.0: agc_driver_tests passes with a new check in testEndOfPipeInterrupts (a RELEASE_MEM with DATA_SEL 3 and INT_SEL 3 writes its label and raises no event). The check fails on main with "release with INT_SEL send data after write confirm raised an interrupt". The existing INT_SEL 1 and 2 cases still raise interrupts.
  • A title that does this no longer crashes on its event thread and starts presenting frames.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4780072093 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1362). Originally posted by [gjonn](https://github.com/gjonn) on 2026-10-08T00:19:57Z. --- ### What The packet executor raised an end-of-pipe interrupt for every `RELEASE_MEM` whose INT_SEL field (bits 24-26 of DW2) was non-zero. INT_SEL 3 is `send_data_after_write_confirm`: the data write waits for write confirmation and no interrupt is sent (values 1 and 2 send an interrupt; Mesa uses 3 for its ordinary fence writes). It no longer raises an interrupt for INT_SEL 3. A title submits a DCB per frame with two `RELEASE_MEM` timestamp writes (DATA_SEL 3, INT_SEL 3) and one interrupt (INT_SEL 1). Its event thread takes the pending submission when a graphics end-of-pipe event arrives and clears it; the two extra events made it dereference a null pending submission (`read of 0x48`) right after start-up. ### Tested - Windows 11, MinGW-w64 GCC 15.2.0: `agc_driver_tests` passes with a new check in `testEndOfPipeInterrupts` (a `RELEASE_MEM` with DATA_SEL 3 and INT_SEL 3 writes its label and raises no event). The check fails on `main` with "release with INT_SEL send data after write confirm raised an interrupt". The existing INT_SEL 1 and 2 cases still raise interrupts. - A title that does this no longer crashes on its event thread and starts presenting frames. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1362
No description provided.