fix(libSceVideoOut): check the output mode calls' arguments as firmware 13.42 does #19293
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19293"
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 zaryabzip on 2026-11-13T02:03:43Z.
What
sceVideoOutGetDeviceInfoEx_andsceVideoOutConfigureOutputMode_now take their firmware arguments and make the checks firmware 13.42 makes before it hands off. They throwNotImplementedonly where the part nobody has read begins. Before this, both threw for any call.Source. @BunnyFl's reading of
libSceVideoOut.sprxon #15134 (comment). It came from disassembly; nothing was run on a console. The issue asked for exactly this: local checks and argument lists in place of the placeholders, even where the rest stays unsupported.sceVideoOutGetDeviceInfoEx_(handle, reserved, info, size)(entry0x161d0), in order:sizeother than 0x18:0x80290001, before the handle.0x8029000b(HasConfigthenIsOpen, as inOutput.cpp).reservednot null:0x80290001.infonull:0x80290002.0BKuKlQG8zE). Here it throws.sceVideoOutConfigureOutputMode_(handle, reserved, mode, forwarded, unused, size)(entry0x156c0, routine0x15760), in order:mode, a non-zeroreservedor asizeother than 0x10 gives0x80290001, before the handle.0x8029000b.0x8029001b. A main-bus port goes on; any other port throws, because how the open's bus type maps to the device's is unknown.+0x10is0xffffffff21ffffffwith+813, 16 or 18, the firmware returns0x80290019. That global isn't known, so this combination throws.0x80290016(UNSUPPORTED_OUTPUT_MODE). The rest of the validator wasn't read, so a valid record throws.Not modelled: the handle lookup's
0x8029001bfor a port record whose+0x10is non-zero. Nothing here sets that state, so it is never returned.Change (
InventoryExports.cppand its header). The two placeholders get these signatures and checks. Theforwardedargument is handed to the unread validator in firmware, andunusedis never read there either.Debt (
libSceVideoOut.md). The two names leave the inventory table. One Unknown-function-info entry records what still throws and why, and the unmodelled0x8029001b.Test (
GuestVideoOutOutputModeChecks.cpp, ctestguest_video_out_output_mode_checks).reserved, wrong size forConfigureOutputMode_). If the port can't open, the test then skips with 77, likeguest_video_out_hdr.0x8029000b, before the other arguments;reservedgives0x80290001, before a nullinfo;infogives0x80290002;0x80290016;sceVideoOutClose, the port gives0x8029000b.Tested
919f7e6624merged ontomaina6606d5bab(comment). Windows 11 Enterprise 22621, AMD RX 6700 XT (driver 26.10.1), MinGW-w64 GCC 15.2 UCRT, Release.VideoOut: invalid output handle:IsOpenthrows for a handle that isn't open.84e5aa6fb4checksHasConfigfirst in both calls, asOutput.cppdoes (review).84e5aa6fb4(tree2856af864d) onmain8ab1200bc2. The 261 latermaincommits up to96b9b4cd64don't touchInventoryExports.*, and the head merges cleanly with thatmain.BUILD_TESTING=ON.ANYPS5_REQUIRE_DISPLAY=1,guest_video_out_output_mode_checkspasses 3 of 3, not skipped. The open-port rows ran, including thehandle + 1rows.guest_video_out_firmware_answersandguest_video_out_hdrpass.main'sInventoryExports.cpp(its two stubs given this PR's parameter lists so it compiles), the test aborts 2 of 2 at its first row (GuestVideoOutOutputModeChecks.cpp:41),sceVideoOutGetDeviceInfoEx_ not implemented.tools/check_conventions.py --base mainpasses.git merge-treefinds no conflict withmain8e7cb8f17cor with any open PR that merges withmain. The test's CMake block sits beforeguest_video_out_firmware_answers, clear of #18919's block after it.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)