feat(libSceVideoOut): register the set-mode event as the output-mode event #17980
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17980"
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-10T02:19:54Z.
What
sceVideoOutAddSetModeEventandsceVideoOutDeleteSetModeEventnow add and remove the output-mode registration, the same assceVideoOutAddOutputModeEventandsceVideoOutDeleteOutputModeEvent. Before this they threwNotImplemented.Source. @BunnyFl's reading of firmware 13.42's
libSceVideoOut.sprxon #15134 (comment):(queue, handle, udata)and(queue, handle). An unknown handle gives0x8029000b. Neither checks the queue orudatabefore the kernel call.AddSetModeEventissceVideoOutAddFlipEventwith one record offset changed (+0x30for+0x20). It registers with filter0xfff3,EV_ADD, fflags 0 and data 0.DeleteSetModeEventissceVideoOutDeleteFlipEventwith the same one change.+0x30(set mode, at0x10f6e) and+0x38(output mode, at0x10f7f), and both calls use the same filter. So in that module the set-mode event and the output-mode event are one kernel registration.sceVideoOutGetEventIdreports 8 for that ident, the idmainalready uses for the output-mode event.Change (
Event.cpp,Event.hpp). The two exports callregisterVideoOutEventanddeleteVideoOutEventwithVIDEO_OUT_EVENT_SET_MODE. A title that adds both events on one queue gets one registration and one event, with theudataof the later call. The placeholders leaveInventoryExports.cpp, its header and the debt table.Debt (
libSceVideoOut.md, Unknown function info). One entry records what is not modelled: on another bus only the set-mode ident is stored andsceVideoOutAddOutputModeEventreturns0x8029001b. The module doesn't say when the kernel posts the event or what its data holds. Here it is armed at once with the current output mode, as the output-mode event already is. The "169 entries" count of the inventory table is left as it is, as in #17914, so this PR doesn't collide with the other open PRs that edit that line.Test (
GuestVideoOutSetModeEvent.cpp, ctestguest_video_out_set_mode_event). It opens the port first and skips with 77 when that fails without a display, likeguest_video_out_hdr.0x8029000b.AddSetModeEventthenAddOutputModeEventon one queue: one event arrives, id 8, with the second call'sudataand the default output mode in its data.DeleteSetModeEvent, a newAddOutputModeEventarms a fresh event, so the delete removed the shared registration. The same holds the other way round, withDeleteOutputModeEventremoving a set-mode registration.Not in this PR (from the same reading): the display-position event pair, whose kernel side is not in the module, and the checks of
sceVideoOutGetDeviceInfoEx_andsceVideoOutConfigureOutputMode_.Tested
07e59d601fonmaina00ad036c4. Since then the debt entry moved (now between the twosceVideoOutSubmitFlipentries, clear of #18033), the table count was kept, and83c99065b1opens the port before the not-open rows (CI's Windows job has no display and aborted at those rows instead of skipping).BUILD_TESTING=ON.guest_video_out_set_mode_eventpasses 3 of 3 withANYPS5_REQUIRE_DISPLAY=1, so it ran rather than skipped.guest_video_out_event_idandguest_video_out_hdrpass. Thevideo_out_fliptests areEXCLUDE_FROM_ALLand were not built.main'sEvent.cpp,InventoryExports.cppandInventoryExports.hpp(this PR'sEvent.hppand test kept), the test aborts 2 of 2 at its first row (GuestVideoOutSetModeEvent.cpp:38):sceVideoOutAddSetModeEvent not implemented. ThelibSceVideoOut.prxcopy beside the test differed between the two builds (sha25671882C2C…and6C3088DD…), so the control ranmain's code.83c99065b1(tree8f9cab0af6), same machine and toolchain, onmaina00ad036c4. The 9 latermaincommits up to11673672d9touch nothing inlibSceVideoOutor the test.guest_video_out_set_mode_eventpasses 3 of 3 withANYPS5_REQUIRE_DISPLAY=1, not skipped. ThelibSceVideoOutsources are byte-identical to07e59d601f, so the control above still applies. No warnings in the changed files.3c999644e5merged ontomain81eb4e1935, a clean merge (comment). Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release,ANYPS5_REQUIRE_VULKAN=1:guest_video_out_set_mode_eventpasses 3 of 3, none skipped. Their CPU-only run with Vulkan hidden (comment) found the abort that83c99065b1fixes.windowscheck, which has no display, passes at83c99065b1.Checked on macOS (arm64, where no full build is possible): the test passes
clang++ -fsyntax-only -Wall -Wextra;tools/check_conventions.py --base mainpasses;git merge-treefinds no conflict withmainor with any open PR that merges withmain. #17914, which also registers set-mode events throughsceVideoOutSysAddSetModeEvent2, merges cleanly with this one.The overlap bot couldn't compare three PRs that already conflict with
main. I checked them withgit merge-tree:libSceVideoOut.md) and #5021 (libSceVideoOut/CMakeLists.txt): no conflict beyond the ones they already have withmain.libSceVideoOut.md): one more conflict hunk. That PR puts a blank line between every entry in 274 debt files, so any new debt entry meets it. Resolving it means keeping both, with a blank line around the new entry.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)