Skip to content

fix(libSceVideoOut): answer the cursor, flip status and pending-flip calls as measured on a PS5 - #8927

Merged
oneandonlydean merged 4 commits into
boykopovar:mainfrom
ionut27001:fix/videoout-cursor-flip-status
Oct 27, 2026
Merged

oneandonlydean merged 4 commits into
boykopovar:mainfrom
ionut27001:fix/videoout-cursor-flip-status

Conversation

@ionut27001

@ionut27001 ionut27001 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

Make the VideoOut cursor, flip-status and is-flip-pending calls return the values measured on a PS5 payload process (firmware 12.70):

  • GetFlipStatus on a fresh handle: ret 0, touches 128 bytes: bytes 24-31 (flipArg) and 56-59 (currentBuffer) are 0xff, every other byte is 0. With null buffer: ret 0x80290002, buffer untouched.
  • IsFlipPending on a fresh handle: returns 0.
  • SetFlipMaster (all argument shapes) on a fresh handle: returns 0x8029000b. ClearFlipMaster: returns 0x8029001c.
  • CursorSetPosition: returns 0 (success). CursorDisable: returns 0. CursorEnable(handle, 0, null): returns 0x80290002. CursorSetImageAddress(handle, 0, null): returns 0x80290002.
  • All of the above on an invalid handle (-1): return 0x8029000b, buffers untouched.

Moves the cursor and flip-fresh implementations from Unimplemented.cpp into Output.cpp (SetFlipMaster and ClearFlipMaster stay as stubs in Unimplemented.cpp; their values above are measurements only) and adds a guest test that pins every measured value.

Overlaps: #8784 adds assertions to core/libs/tests/GuestVideoOutCursor.cpp, which this PR removes (its cases expected all four cursor calls to throw on an unopened handle, which the measurement contradicts); whichever lands second rebases, and its two flip-master assertions can move into tests/Flip.cpp. #6977 declares the same four cursor exports as parameterless throwing stubs inside a much larger PS4-on-AGC change that already conflicts with main; this PR implements them with measured behaviour, so the two cannot both merge as they are. File overlaps only: #7814 and #4040 (Output.cpp, debt file), #7965 (debt file), #8418 and #6044 (Flip.cpp).

Tested

Windows 11, guest tests (video_out, videoout, flip): 29/29 pass twice; the new test (video_out_flip_fresh) passes directly with ANYPS5_VIDEO_OUT_TEST_DRIVER=windows twice. Revert check: removing the fix fails the new test as expected.

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 under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a (no GPU changes; cursor/flip logic is CPU-side)
  • AI-assisted: yes

@MarcZX10

Copy link
Copy Markdown
Contributor

The current Conventions run fails only on the template checklist: Depends on: none, Fixes: none, and Unblocks: none are still unchecked. Please check those three boxes (or replace them with applicable values) and rerun; the rest of the current required checks shown are passing.

@ionut27001

Copy link
Copy Markdown
Contributor Author

Checked the three boxes (all three are none) and corrected the flip-status byte description in the body (bytes 56-59 are 0xff as well, as the test pins).

@MarcZX10

Copy link
Copy Markdown
Contributor

Thanks for checking the three checklist items and correcting the byte description. I verified the latest Conventions run now passes; the current required intake/report checks also pass. The remaining platform build jobs are skipped by the workflow for this PR.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 11414 docs/dev/debt/libSceVideoOut.md L29

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 674 core/libs/prx/libSceVideoOut/CMakeLists.txt
PR 4040 core/libs/prx/libSceVideoOut/src/Output.cpp
docs/dev/debt/libSceVideoOut.md
PR 5021 core/libs/prx/libSceVideoOut/CMakeLists.txt
core/libs/prx/libSceVideoOut/tests/Flip.cpp
PR 6977 core/libs/prx/libSceVideoOut/Unimplemented.cpp
core/libs/prx/libSceVideoOut/tests/Flip.cpp
docs/dev/debt/libSceVideoOut.md
PR 7201 core/libs/prx/libSceVideoOut/CMakeLists.txt
PR 9431 core/libs/prx/libSceVideoOut/tests/Flip.cpp
PR 9432 core/libs/prx/libSceVideoOut/Unimplemented.cpp
core/libs/prx/libSceVideoOut/tests/Flip.cpp
docs/dev/debt/libSceVideoOut.md
PR 9672 core/libs/prx/libSceVideoOut/tests/Flip.cpp
PR 9673 core/libs/prx/libSceVideoOut/tests/Flip.cpp
docs/dev/debt/libSceVideoOut.md
PR 9674 core/libs/prx/libSceVideoOut/tests/Flip.cpp
PR 9675 core/libs/prx/libSceVideoOut/tests/Flip.cpp
PR 9676 core/libs/prx/libSceVideoOut/Unimplemented.cpp
core/libs/prx/libSceVideoOut/tests/Flip.cpp
docs/dev/debt/libSceVideoOut.md
PR 9842 core/libs/prx/libSceVideoOut/tests/Flip.cpp
PR 9880 core/libs/prx/libSceVideoOut/CMakeLists.txt
core/libs/prx/libSceVideoOut/src/Output.cpp
docs/dev/debt/libSceVideoOut.md
PR 9891 core/libs/prx/libSceVideoOut/tests/Flip.cpp
PR 10435 core/libs/prx/libSceVideoOut/tests/Flip.cpp
PR 11207 core/libs/prx/libSceVideoOut/CMakeLists.txt

@MarcZX10

Copy link
Copy Markdown
Contributor

I checked the latest run: the follow-up conventions check passed after the earlier template failure. Thanks for fixing it.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@ionut27001 Please drop Flip.cpp:1025–1029’s five assertions that unsupported cursor operations throw, plus :1035’s explicitly unmeasured invalid-handle/null GetFlipStatus assertion: the tests should not pin unimplemented behaviour. Retain measured error codes and fresh-handle checks. Please also correct the description’s SetFlipMaster/ClearFlipMaster implementation claim, since Unimplemented.cpp:10–18 still has their unchanged stubs. During rebase, preserve the platform-specific test-driver default and remove only the superseded cursor test target.

@harisibrar1 harisibrar1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked against main b607bfd and the struct/error constants on main:

  • The error constants and the flip-status offsets match main (flipArg at 24 and currentBuffer at 56 in VideoOutFlipStatus; 0x80290002/0x8029000b in VideoOutDriver.hpp), and the check order in the new code matches each measured case. It needs a rebase: git merge-tree shows conflicts in all five shared files.
  • After rebasing: main's 61a44c7 gave sceVideoOutSetFlipMaster(handle, masterHandle) and sceVideoOutClearFlipMaster(handle) signatures (Unimplemented.cpp:10, :15) and removed the "declared without parameters, signatures unknown" debt line. The new flip-master debt line still says the shapes are unknown, so it would contradict main. Keeping the measured codes with the signatures main now has would fix that (main has no debt entry for these two stubs, so the line is still worth having).
  • Coverage note: guest_video_out_cursor runs with no skip code, but its replacement, video_out_flip_fresh, opens a port first, and the flip test's main() returns 77 when there's no Vulkan display. I couldn't run it, but reading the code, the handle -1 cursor checks would then be skipped on headless hosts. Running those checks before sceVideoOutOpen would keep them always on.
  • Small one: the closed-handle case the cursor debt line mentions ("answered like -1") isn't exercised by the test.

Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@ionut27001 This PR now conflicts with main in core/libs/prx/libSceVideoOut/CMakeLists.txt, core/libs/prx/libSceVideoOut/tests/Flip.cpp, core/libs/tests/GuestVideoOutCursor.cpp, docs/dev/debt/libSceVideoOut.md. Main’s VideoOut cursor coverage, output-resolution tests and platform-specific test setup overlap this PR’s fixtures and registration. Main now requires each exported function to be declared once, in the library's public header (checked by the public_headers tests). Could you reconcile the cursor and fresh-port assertions with the current resolution coverage and platform setup?

…p status calls

The removed checks asserted the exact failure text of cursor image, image
address and index calls and of a null flip status output. Those calls are
still not implemented and still refuse explicitly; the tests no longer pin
what they answer.
Main declares sceVideoOutCursorEnable, Disable, SetImageAddress and
SetPosition in the library's public header; the second declarations in
Output.hpp made the header audit fail on duplicates.
@oneandonlydean

Copy link
Copy Markdown
Collaborator

@ionut27001 I pushed the change from my earlier review to this branch, since the PR has been quiet since 21 Oct. The first commit removes the five cursor expectFailure checks and the "not measured" GetFlipStatus check in Flip.cpp, as asked. Then there's a merge of current main (CMakeLists.txt, Unimplemented.cpp, tests/Flip.cpp and the debt entry needed resolving; both sides are kept), and one commit dropping the four cursor declarations from Output.hpp, which main's VideoOut.hpp now declares. All the video_out_flip modes pass on Linux; full CI on the new head follows. If you'd rather do any of it differently, feel free to replace it.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 26, 2026
@oneandonlydean
oneandonlydean merged commit e55c69f into boykopovar:main Oct 27, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants