fix(libSceVideoOut): accept an output mode left at any in every field #22517
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22517"
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-17T18:36:10Z.
What
On
main,sceVideoOutConfigureOutputMode_checks its arguments in firmware 13.42's order (#19293) and then throws for every mode record that passes them. With this change, on a main-bus port, it returns 0 and changes nothing for a record whose first word is 0x20 and whose bytes 4 to 0x1f are all 0xff (every field "any", which is howsceVideoOutModeSetAny_fills it), when the fourth argument is null. Any other record whose first word is 0x20, and a non-null fourth argument, still throw.VideoOutDriver::Opengives busnhandlen + 1). It then sends the request to libSceAvSetting and returns that module's reply, mapped to VideoOut codes; what comes back through libSceAvSetting's IPC was not read. So the 0 is inferred, as the new Unknown function info entry says. The run called the validator directly with five imports stubbed to return 0, among themsceKernelGetPs4CompiledSdkVersion; it read firmware 13.42's PS5 module, and PS4 firmware's libSceVideoOut was not read.mainkeeps none of them, and returning 0 leaves what it does model (the output modesceVideoOutConfigureOutputstores, host HDR) as it is and posts no set-mode event. What the console does with such a request is not known, and a record that asks for a value still throws. Other no-op display calls under Silent stubs, such assceVideoOutVrrPegToFixedRateandsceVideoOutSetWindowModeMargins, are the same kind.sceVideoOutModeSetAny_(&mode, 0x20)after registering the display buffers. They then write only+6: 0x0c or 0xff (whatsceVideoOutModeSetAny_put there), chosen by a flag that also picks the buffers' pixel format (0x88740000 with 0x0c). The call is(handle, 0, &mode, 0, 0x20, 0x10), and its result is not checked.mainhas now and left the function throwing; after BunnyFl's run they kept it throwing because what the validator accepts depends on the flag bits; this covers only the record that passed with them clear. I asked them on #15134 before opening this and have had no answer.sceVideoOutGetDeviceInfoEx_, sceVideoOutConfigureOutputMode_entry and adds a Silent stubs entry and an Unknown function info entry for this record.Tested
Windows 10 Pro 22H2 (19045), NVIDIA GeForce RTX 5080 (driver 621.14), WinLibs GCC 15.2.0 (r7), CMake 4.3.1, Release, this branch on
main4b83e9d223.main's ownagc_driver_upload_cache_read_only_flush_testsdoes not build with MinGW (setenv; open #19899 fixes it), so the builds went on past it.guest_video_out_output_mode_checks: passes, with its new checks. A record left at any returns 0, and the same record with its first word 0x1f still returns 0x80290016. These calls still throw: the record with any one of bytes 4 to 0x1f set to 0 (28 calls), the record with colorimetry 0x0c, and the record left at any with a non-null fourth argument. Each throw must besceVideoOutConfigureOutputMode_ not implemented, counted once byNotImplementedCalls_nid_no_patch. Without theInventoryExports.cppchange it fails withsceVideoOutConfigureOutputMode_ not implemented, and each of 7 further deliberate breaks fails it: accepting every record whose first word is 0x20, ignoring the fourth argument, skipping byte 4, skipping the last byte, checking only byte 6, checking only bytes 4, 6 and 0x1f, and moving the new check above the first-word check. It also passes in a build configured with-DANYPS5_ENABLE_SPIRV_TOOLS=ON.tools/select_tests.pyselects for the 3 changed files (ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1), onmainand on this branch: 1,184 pass on both.performance_runner_PerformanceRunTestsfails on both, because a clean performance capture refusesANYPS5_NO_SHADER_CACHE, andguest_video_out_wqhd_detection_no_vulkanis skipped on both (it points the Vulkan loader at a missing driver file).VK_LAYER_KHRONOS_validation1.4.367 (VK_ADD_LAYER_PATH=<the layer's folder> VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer VK_LOADER_LAYERS_DISABLE=~implicit~ ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1), the 63 tests matchingvideo_out|videoout,ctest -V, onmainand on this branch: each log has 49Insert instance layer "VK_LAYER_KHRONOS_validation"lines from 48 tests, no "was not found" line and noVUID-message. 62 pass on both, andguest_video_out_wqhd_detection_no_vulkanis skipped on both, as above.main'stools/unwrap_self.pyand converted with--windows --registry --trace-imports. Both starts ran onmainbe4613dd73with #18235, #17711 and #18184 merged locally (#17711's one conflicting file,libSceGnmDriverForNeoMode/Export.cpp, keptmain's version) and a local answer for libSceDiscMap'sfJgP+wqifno(asked about on #10531); the load needs all of them. One traced start each:sceVideoOutConfigureOutputMode_ not implemented, before the first frame;std::all_of): gets past the call, so its record was all 0xff; presents its first frame and stops 26.7 s in on an AGC driver error, a separate gap. The image descriptor of compute shader0x2f2fa2500(format 22) matches none of the image modes of its static interface.python tools/check_conventions.py --base origin/mainwith this title and description: all checks passed.python tools/pr_overlap.py --branch: no overlap with open pull requests; the two that share files or exports with this branch merge cleanly with 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)AI-assisted: Claude Code found the title's call sites in its executable, wrote the change and its test, ran the tests and the inFAMOUS starts, and drafted this description; separate review agents checked it.
🤖 Generated with Claude Code