feat(libSceGnmDriver): implement sceGnmRequestFlipAndSubmitDone #23696

Open
Iamharshit00 wants to merge 1 commit from upstream-pr/23696 into main
Iamharshit00 commented 2026-11-19 13:31:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Iamharshit00 on 2026-11-19T13:31:43Z.


What

  • Implements sceGnmRequestFlipAndSubmitDone (NID gObODli-OH8) as the six-argument request-flip path: reserve the EOP flip with sceVideoOutSubmitEopFlip, patch the 0x100-byte/64-dword command buffer with a WRITE_DATA surface lock and a token RELEASE_MEM, submit through the locked GnmDriver submit path, then end the frame.
  • Maps a full VideoOut flip queue to 0x80d11081; null or unwritable command buffers return 0x80d11000 as a host-safety fallback.
  • Adds packet/status/error tests and a debt fragment for unmeasured console details. PR #6977 adds a stub for this export, so this PR depends on it.

Tested

  • Not tested on PS4 or GPU: CMake, Ninja and a C++ compiler are unavailable in this environment.
  • Static checks passed on Windows: python tools/check_conventions.py --base origin/main, python tools/debt_fold.py --check, git diff --check, and python tools/guest_pointer_audit.py libSceGnmDriver (19 pre-existing findings, none for this export).

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • 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: #6977
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5395865543 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23696). Originally posted by [Iamharshit00](https://github.com/Iamharshit00) on 2026-11-19T13:31:43Z. --- ### What - Implements `sceGnmRequestFlipAndSubmitDone` (NID `gObODli-OH8`) as the six-argument request-flip path: reserve the EOP flip with `sceVideoOutSubmitEopFlip`, patch the 0x100-byte/64-dword command buffer with a WRITE_DATA surface lock and a token RELEASE_MEM, submit through the locked GnmDriver submit path, then end the frame. - Maps a full VideoOut flip queue to `0x80d11081`; null or unwritable command buffers return `0x80d11000` as a host-safety fallback. - Adds packet/status/error tests and a debt fragment for unmeasured console details. PR #6977 adds a stub for this export, so this PR depends on it. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> - Not tested on PS4 or GPU: CMake, Ninja and a C++ compiler are unavailable in this environment. - Static checks passed on Windows: `python tools/check_conventions.py --base origin/main`, `python tools/debt_fold.py --check`, `git diff --check`, and `python tools/guest_pointer_audit.py libSceGnmDriver` (19 pre-existing findings, none for this export). ### 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) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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: #6977 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-22 18:40:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T18:40:39Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the review supports merging, though the implementation’s console behavior remains unmeasured.

What I ran

Reviewed head 7133e14c341e4a2d01be7942fde546694b2949bf and the prepared diff. No commands or tests were run.

Results

Check Result Note
Changed code review passed All five changed files were read
Tests not run Build tools unavailable per PR description
Console behavior not run Implementation notes identify unmeasured details

Findings

Blocking

None.

Non-blocking

None.

Not verified

No tests were run. PS4 and GPU behavior, including the EOP completion label, NOP payload, and submit-done boundary, was not verified. All changed files listed in the manifest were read; no changed files were excluded. files.json was not available in the prepared review folder, so additional exclusions beyond the manifest were not verified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6013792266 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23696#pullrequestreview-6013792266). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T18:40:39Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the review supports merging, though the implementation’s console behavior remains unmeasured. ## What I ran Reviewed head `7133e14c341e4a2d01be7942fde546694b2949bf` and the prepared diff. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | All five changed files were read | | Tests | not run | Build tools unavailable per PR description | | Console behavior | not run | Implementation notes identify unmeasured details | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified No tests were run. PS4 and GPU behavior, including the EOP completion label, NOP payload, and submit-done boundary, was not verified. All changed files listed in the manifest were read; no changed files were excluded. `files.json` was not available in the prepared review folder, so additional exclusions beyond the manifest were not verified. ## To get this to a good state Nothing is required.
ligmaSec commented 2026-12-03 17:24:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T17:24:17Z.

Review: COMMENTED


sceGnmRequestFlipAndSubmitDone reserves a queue entry through sceVideoOutSubmitEopFlip before copying or submitting the packet. If the command-buffer copy fails, it returns an error with the reservation still pending. Submission failure can also leave the token without a completion packet. One abandoned token occupies a flip queue slot and repeated failures can leave later requests reporting a full queue. Please arrange for an unsubmitted reservation to be released on every failure path. The current short-buffer check runs before reservation, so it leaves this path uncovered.

This finding is from source inspection at 7133e14c34. The branch also has a merge conflict in libSceGnmDriver/Export.cpp against main at 9fcd37e4ea, which prevents the paired Vulkan run as submitted.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6174903954 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23696#pullrequestreview-6174903954). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T17:24:17Z. **Review:** COMMENTED --- `sceGnmRequestFlipAndSubmitDone` reserves a queue entry through `sceVideoOutSubmitEopFlip` before copying or submitting the packet. If the command-buffer copy fails, it returns an error with the reservation still pending. Submission failure can also leave the token without a completion packet. One abandoned token occupies a flip queue slot and repeated failures can leave later requests reporting a full queue. Please arrange for an unsubmitted reservation to be released on every failure path. The current short-buffer check runs before reservation, so it leaves this path uncovered. This finding is from source inspection at `7133e14c34`. The branch also has a merge conflict in `libSceGnmDriver/Export.cpp` against `main` at `9fcd37e4ea`, which prevents the paired Vulkan run as submitted. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/23696:upstream-pr/23696'
git switch 'upstream-pr/23696'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/23696'
git switch 'upstream-pr/23696'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/23696'
git switch 'upstream-pr/23696'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/23696'
git switch 'main'
git merge --squash 'upstream-pr/23696'
git switch 'main'
git merge --ff-only 'upstream-pr/23696'
git switch 'main'
git merge 'upstream-pr/23696'
git push origin 'main'
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!23696
No description provided.