fix(libSceVideoOut): refuse the output status with VRR for a handle without buffers #17812

Merged
xXPBSXx merged 3 commits from upstream-pr/17812 into main 2026-11-15 20:06:45 +00:00
xXPBSXx commented 2026-11-09 16:56:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-11-09T16:56:13Z.


What

sceVideoOutGetOutputStatusWithVrr filled the 80-byte status for a handle that has no buffer registered. A PS5 returns 0x8029001C and writes nothing for it. It now does the same, with the check sceVideoOutClearFlipMaster already uses. The tests pin the refusal on a fresh handle and that the call succeeds once a buffer is registered. The debt entry for sceVideoOutGetOutputStatusWithVrr (docs/dev/debt/libSceVideoOut.md) said the console's 0x8029001C check "tests states that are not modelled and are never reported"; the entry now states the measured result for a fresh handle and keeps the 0x8029001B object-field check as not modelled. Titles are not affected as far as measured: the title measurement (firmware 13.40) called it after its buffers were registered; no title is known to call it on a fresh handle.

Tested

Measured on a PS5 with firmware 11.60 (kernel_get_fw_version 0x11600005), from a homebrew payload process (ps5-payload-sdk v0.45, elfldr), on 2026-11-09 at 08:24 UTC; the console's own clock read about 1 h 41 min more (see the first comment). A title process may differ.

call on a handle from sceVideoOutOpen(0xff, 0, 0, NULL) with no buffer registered PS5, payload process, firmware 11.60 main before here now
sceVideoOutGetOutputStatusWithVrr(handle, &status) return 0x8029001C 0 0x8029001C
bytes of status written 0 80 0

On Windows 10 Pro with MinGW GCC (WinLibs), a Release build, ANYPS5_REQUIRE_VULKAN=1 and a shader cache off, on main 67092e70b5 the test commit alone fails video_out_flip_resolution_override, guest_video_out_resolution_status and guest_video_out_hdr (3 of 3), and with the fix commit on the same main all three pass. tools/check_conventions.py --base upstream/main passes. The runs used no Vulkan validation layer, because the added check returns before any Vulkan call.

Overlap: the 24 other open pull requests that change docs/dev/debt/libSceVideoOut.md, Output.cpp, Flip.cpp, GuestVideoOutHdr.cpp or GuestVideoOutResolutionStatus.cpp (listed by update time) were checked on 2026-11-09 between 16:30 UTC and 16:38 UTC against main f6ed718e10. Four already conflict with main without this change (#4040 and #14212 in the debt file, #12315 and #5021 in other files). #16463 (a documentation sync of 39 files, a different author) conflicts in GuestVideoOutHdr.cpp only with this change, because both touch that test file; whichever merges second needs a small rebase. The other nineteen merge cleanly with and without it, among them #17696, #17763, #16584 and #14106, which edit other entries of the debt file.

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 (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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4080 SUPER, Windows driver version 32.0.16.1074, Windows 10 Pro
  • AI-assisted: yes

AI-assisted (Claude Code).

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5227722087 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17812). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-11-09T16:56:13Z. --- ### What `sceVideoOutGetOutputStatusWithVrr` filled the 80-byte status for a handle that has no buffer registered. A PS5 returns `0x8029001C` and writes nothing for it. It now does the same, with the check `sceVideoOutClearFlipMaster` already uses. The tests pin the refusal on a fresh handle and that the call succeeds once a buffer is registered. The debt entry for `sceVideoOutGetOutputStatusWithVrr` (docs/dev/debt/libSceVideoOut.md) said the console's `0x8029001C` check "tests states that are not modelled and are never reported"; the entry now states the measured result for a fresh handle and keeps the `0x8029001B` object-field check as not modelled. Titles are not affected as far as measured: the title measurement (firmware 13.40) called it after its buffers were registered; no title is known to call it on a fresh handle. ### Tested Measured on a PS5 with firmware 11.60 (`kernel_get_fw_version` 0x11600005), from a homebrew payload process (ps5-payload-sdk v0.45, elfldr), on 2026-11-09 at 08:24 UTC; the console's own clock read about 1 h 41 min more (see the first comment). A title process may differ. | call on a handle from `sceVideoOutOpen(0xff, 0, 0, NULL)` with no buffer registered | PS5, payload process, firmware 11.60 | `main` before | here now | |---|---|---|---| | `sceVideoOutGetOutputStatusWithVrr(handle, &status)` return | `0x8029001C` | 0 | `0x8029001C` | | bytes of `status` written | 0 | 80 | 0 | On Windows 10 Pro with MinGW GCC (WinLibs), a Release build, `ANYPS5_REQUIRE_VULKAN=1` and a shader cache off, on `main` `67092e70b5` the test commit alone fails `video_out_flip_resolution_override`, `guest_video_out_resolution_status` and `guest_video_out_hdr` (3 of 3), and with the fix commit on the same `main` all three pass. `tools/check_conventions.py --base upstream/main` passes. The runs used no Vulkan validation layer, because the added check returns before any Vulkan call. Overlap: the 24 other open pull requests that change `docs/dev/debt/libSceVideoOut.md`, `Output.cpp`, `Flip.cpp`, `GuestVideoOutHdr.cpp` or `GuestVideoOutResolutionStatus.cpp` (listed by update time) were checked on 2026-11-09 between 16:30 UTC and 16:38 UTC against `main` `f6ed718e10`. Four already conflict with `main` without this change (#4040 and #14212 in the debt file, #12315 and #5021 in other files). #16463 (a documentation sync of 39 files, a different author) conflicts in `GuestVideoOutHdr.cpp` only with this change, because both touch that test file; whichever merges second needs a small rebase. The other nineteen merge cleanly with and without it, among them #17696, #17763, #16584 and #14106, which edit other entries of the debt file. ### 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 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: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: NVIDIA GeForce RTX 4080 SUPER, Windows driver version 32.0.16.1074, Windows 10 Pro <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no --> AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
milescoviello commented 2026-11-09 17:10:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-11-09T17:10:10Z.

Review: APPROVED


Read cee35fd34c against main.

  • The check: isFreshHandle (Output.cpp:304) is !cfg->buffersEverRegistered under the config mutex, the same test sceVideoOutClearFlipMaster uses (:321) for the same 0x8029001C. It takes and releases the lock before sceVideoOutGetOutputStatusWithVrr takes it again, so there's no nested locking.
  • Order: the null-status (INVALID_ADDRESS) and handle checks still come first. A fresh handle returns before the status is filled, which gives the measured "0 bytes written".
  • Scope: a handle that registered buffers and then unregistered them still reports, because buffersEverRegistered stays set. That case wasn't in the measurement, so keeping main's answer for it is right.
  • Tests: the existing tests that read the VRR status now register a buffer first, and each first pins the measured refusal on the fresh handle.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5829658699 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17812#pullrequestreview-5829658699). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-11-09T17:10:10Z. **Review:** APPROVED --- Read `cee35fd34c` against `main`. - **The check:** `isFreshHandle` (`Output.cpp:304`) is `!cfg->buffersEverRegistered` under the config mutex, the same test `sceVideoOutClearFlipMaster` uses (`:321`) for the same `0x8029001C`. It takes and releases the lock before `sceVideoOutGetOutputStatusWithVrr` takes it again, so there's no nested locking. - **Order:** the null-status (`INVALID_ADDRESS`) and handle checks still come first. A fresh handle returns before the status is filled, which gives the measured "0 bytes written". - **Scope:** a handle that registered buffers and then unregistered them still reports, because `buffersEverRegistered` stays set. That case wasn't in the measurement, so keeping `main`'s answer for it is right. - **Tests:** the existing tests that read the VRR status now register a buffer first, and each first pins the measured refusal on the fresh handle. AI-assisted: yes (Claude Code)
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!17812
No description provided.