fix(libSceVideoOut): accept buffer option 8 from PS4 callers #18033
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18033"
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 adam25136 on 2026-11-10T06:42:26Z.
What
The PS4
sceVideoOutRegisterBuffersandsceVideoOutSubmitChangeBufferAttributethrewVIDEO_OUT_ERROR_INVALID_OPTIONfor any nonzerooption. Both now accept option 8 (VIDEO_OUT_BUFFER_ATTRIBUTE_OPTION_STRICT_COLORIMETRY) and store it in the buffer group, whereDescribeVideoOutBufferbuilds the same display buffer as for option 0. That is what #647 did for the PS5 calls,sceVideoOutRegisterBuffers2andsceVideoOutSubmitChangeBufferAttribute2. Any other option still throwsVIDEO_OUT_ERROR_INVALID_OPTION.A PS4 title passes it: the first
sceVideoOutRegisterBufferscall of CUSA00223 01.07 registers two tiled 3840x2160A8R8G8B8_SRGBbuffers with option 8 (see Tested). What a console does with option 8 is not known, for PS4 or PS5 callers, and whether a PS4 title's 8 means the same as a PS5 title's was not measured.docs/dev/debt/libSceVideoOut.md:A8R8G8B8_SRGBandA8B8G8R8_SRGBbuffers "without options". The same entry says tiled buffers register, andPs5PixelFormatalso accepts0x88000000, so it now reads:A8R8G8B8_SRGB,A8B8G8R8_SRGBand0x88000000buffers, linear or tiled, with option 0 or 8.Tested
Windows 10 Pro 22H2 (19045), i9-12900KF, NVIDIA GeForce RTX 5080 (driver 621.14), WinLibs GCC 15.2.0 r7, CMake 4.3.1, Ninja, Release,
BUILD_TESTING=ON, onmain53bb992782, withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1.video_out_flip_ps4:sceVideoOutSubmitChangeBufferAttributewith option 8 must succeed and store it, and changing back to option 0 must leave the group as before.video_out_flip_ps4fail without the change? Each time with this PR's test kept:sceVideoOutRegisterBufferscheck back tooption != 0: fails,sceVideoOutRegisterBuffers: VIDEO_OUT_ERROR_INVALID_OPTION;sceVideoOutSubmitChangeBufferAttributecheck back tooption != 0: fails,sceVideoOutSubmitChangeBufferAttribute: VIDEO_OUT_ERROR_INVALID_OPTION;video_out_flip_tests withVK_LAYER_KHRONOS_validation, implicit layers disabled, onmainand with this change: 28 of 28 pass on each side, with noVUID-line and no "was not found but was requested by env var VK_INSTANCE_LAYERS" line. AVK_LOADER_DEBUG=layerrerun ofvideo_out_flip_ps4shows the loader inserting the layer.tools/select_tests.py selectpicks for the three changed files: 1,116 of 4,890. With this change, 1,112 pass,guest_kernel_sys_paths_symlinkat_patchedtimes out, andagc_driver_resource_cache_pending_fail_count,agc_driver_resource_cache_pending_fail_count_indexandguest_video_out_wqhd_detection_no_vulkanskip (exit code 77). Onmainthe same test times out and the same three skip here.main: CUSA00223 does not get as far as this call. It stops at load on the 47 imports of #17581, as measured onmain22ae9a397d.libSceGnmDriverForNeoMode.prxfor it (#17581), and leaving 0 instead of 1 in a destroyed rwlock handle, which goes against the PS5 measurement indocs/dev/debt/libkernel.md. The title's own file library destroys its rwlocks and then uses them again. I started it 8 times. 4 starts stopped earlier, in that file library. The other 4 each calledsceVideoOutSetBufferAttribute, bothsceVideoOutRegisterBufferscalls,sceVideoOutModeSetAny_and thensceVideoOutConfigureOutputMode_, which is not implemented.main1a13265e8b, 3 of 8 starts reached the firstsceVideoOutRegisterBufferscall and ended there withVIDEO_OUT_ERROR_INVALID_OPTIONfor pixel format0x80000000, tiling mode 0, 3840x2160, pitch 3840 and option 8.main56619b998cbefore opening (headfd04d1db8e): none of the 17 commits since53bb992782toucheslibSceVideoOut, the GNM libraries, the relinker, the libkernel thread code or this PR's three files. Built there, the 28video_out_flip_tests pass again withVK_LAYER_KHRONOS_validationand noVUID-line.65cc907322, tested with the same files before they were folded into one commit): the debt entry no longer takes the option names from other emulators, and the existing option 1 checks already test a refused option in both PS4 calls. Merged locally intomain1b485ff745: the 28video_out_flip_tests pass, and 28 of 28 again withVK_LAYER_KHRONOS_validationand noVUID-line.video_out_flip_ps4fails with a check accepting every option ("a PS4 buffer option was accepted") and with one refusing option 8 (sceVideoOutSubmitChangeBufferAttribute: VIDEO_OUT_ERROR_INVALID_OPTION), and passes unchanged.python tools/check_conventions.py --base origin/mainwith this title and description: all checks pass.tools/pr_overlap.py --branch(in a full clone, 1,989 open pull requests): 28 share a file with this branch.docs/dev/debt/libSceVideoOut.mddirectly before the PS4 callers entry that this PR rewords. Keeping both resolves it.sceVideoOutGetResolutionStatusentry (line 28 onmain). #5021 changesFlip.cpponly around lines 17, 884 and 919, away from the checks this PR adds. #14212, already conflicting withmain, adds a blank line between all the entries of that file, this one included.Not covered: what a PS4 or PS5 console does with option 8; options other than 0, 1 and 8; Linux and macOS (the change is platform-independent, but the tests ran only on Windows).
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code