fix(videoout): read the open param as the service thread's priority and affinity #297
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/297"
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 oneandonlydean on 2026-10-01T23:15:54Z.
What
Follow-up to #128, which guessed wrong on two points. The first word of the
sceVideoOutOpenparam is not its size, and PPSA21564 does not pass a zeroed param. Its main port is opened with:It also calls
sceVideoOutOpen(0xff, 0, 0, NULL)once. On main the open with this param throwsparam options not implemented, so PPSA21564 cannot open its video port and fails at startup.The layout matches shadPS4's
ServiceThreadParams(src/core/libraries/videoout/driver.h:unknown,set_priority,priority,set_affinity,affinity), i.e. the scheduling settings of libSceVideoOut's service thread. The call site in PPSA21564 agrees: it zeroes the stack block, stores the first 16 bytes from a constant (16, 1, 0x100, 1) and thenmovq $0x1fffat offset 16 before the call. 256..767 is the thread priority range (256 highest), and 0x1FFF covers the 13 CPUs available to a title.Changes:
VideoOutOpenParamdescribes the five fields;VIDEO_OUT_OPEN_PARAM_SIZEbecomesVIDEO_OUT_OPEN_PARAM_FIRST_WORD.validateOpenParamthrows for a first word other than 16, a flag other than 0 or 1, a priority outside 256..767 when its flag is set, and an affinity mask that is 0 or has bits outside 0x1FFF when its flag is set. It reads the u64 at offset 16 only when the affinity flag is set, so a 16-byte param with both flags clear is still read in bounds.Tested
video_out_flip_tests controls(not part of ctest) gainstestOpenParam: eight invalid params throw (first word 24, a priority flag of 2, an affinity flag of 0x101, priority 255 and 768, affinity 0, 0x2000 and a bit above 32), and a 16-byte param with both flags clear, a priority of 767 and an affinity of 1 open a port. The controls themselves now run on a port opened with PPSA21564's exact 88-byte param. On main the test fails at the first valid param (param options not implemented).ctest: 105/105 pass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository