fix(videoout): support permitted high-frame-rate output for Quake II #3886
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3886"
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 PrintOrb on 2026-10-11T18:40:48Z.
What
Yamagi Quake II (PPSA99007) stops before its first frame on main
a11c8f7f7:Its packaged param.json declares
attribute3=0x80040, but VideoOut rejects mode 15 unconditionally. Report mode 15 as supported when the window's current display runs at 120 Hz or above, require the HFR permission bit0x40to configure it, and deliver 119.88 Hz vblanks for that port. Mode 1 restores 59.94 Hz. Slower displays retain the unsupported-mode error; display-query failures throw. No game-specific branch, fallback, retry, or runtime environment switch is added.Semantics: PS5_Vulkan R92 console measurements establish that support queries are independent of title permission, configuration requires HFR permission, and mode 15 halves the vblank period. The single-bit permission mask
attribute3 & 0x40is inferred from the measured full value0x80040; it has not been isolated by a console measurement and is recorded as technical debt. Host display mode switching and VRR remain unimplemented and are recorded in TechnicalDebt.Tested
Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0 r7, AMD Radeon RX 5600 XT, driver 32.0.21045.5002; current display 1920x1080 at 120 Hz. Release runtime
libsbuilt successfully, default SPIRV-Tools setting OFF.guest_video_out_high_frame_rate,guest_video_out_output_mode,guest_video_out_resolution_status, andparam_json_parserpass. Sixty vblanks measure 1.001 s in default mode, 0.500 s in mode 15, and 1.001 s after restoring mode 1. The test uses only HFR bit0x40, and the existing output-mode test checks rejection when permission is absent.--require-high-frame-rate, against preserved main libraries fails with120 Hz output not reported as supported; it passes with this change.video_out_flip_tests controlspasses on the native display. Its CTest offscreen invocation skips because that SDL backend has no Vulkan support here.support=00000001 preset=00000000 result=00000000, the main menu renders, and the first run records at least 2,280 frames before a separatesubmission retirement failedtermination. This fixes the startup blocker; sustained gameplay and keyboard input are not established.video_out_output_mode_policytests the production mode validator directly with refresh rates -1, 0, 30, 59, 60, 119, 120, 144 and 240 Hz, plus option validation and error precedence. It opens no window and does not skip. The revised runtimelibsbuild and this test plusparam_json_parserpass. Removing the slower-display rejection makes the policy test fail at its threshold assertion; restoring it passes.SDL_GetWindowDisplayIndex+SDL_GetCurrentDisplayModepair over five 200,000-call rounds: 78.7-97.4 ns per pair. The per-present-loop query is retained; this does not benchmark other SDL backends or multi-display setups.git diff --checkpass. Full CTest and Linux execution were not run. The earlier native vblank and title results above predate this review follow-up; they were not rerun.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 (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T18:48:04Z.
Review: CHANGES_REQUESTED
Thanks, the approach (support from the host display, permission checked at configure, per-config vblank cadence) looks reasonable. Points to fix:
Output.cpp:242masksattribute3 & 0x40, but the citedWINE_PS5_BUILD.mddoesn't mentionattribute3or this bit (checked), and PS5_Vulkan R92/R51 only measured the full value0x80040. Please cite the source that isolates0x40, or add a TechnicalDebt line saying the single-bit mask is inferred from the full0x80040measurement.Flip.cpp:291-292andGuestVideoOutOutputMode.cpp:55-56now accept either result, and every CI job runs with the offscreen SDL driver where these tests skip. Nothing in CI pins the unsupported branch any more. Please keep a check that fails when the display reports < 120 Hz (e.g. assert unsupported in the skip-free path you can reach, or expose the refresh-rate source so a test can inject it).VideoOutDriver.cpp:613callsSDL_GetWindowDisplayIndex+SDL_GetCurrentDisplayModeon every present-loop iteration. Refresh only when the window reports a display change/move event, or measure that the per-frame cost is negligible.resolution_status/wqhd_detectiontests on this host, so I don't attribute that to the PR). Build andparam_json_parserpass.Imported from boykopovar/AnyPS5. Originally posted by PrintOrb on 2026-10-11T19:48:11Z.
Addressed the three actionable review points in
cef97424a:The revised Release libs build passes. video_out_output_mode_policy and param_json_parser pass 2/2; conventions, test registration and git diff --check pass. Native vblank/title testing was not rerun for this update, and Linux/full CTest were not run. This update does not claim Quake II gameplay; a later P20 shader stop is reported separately in #1413.
AI-assisted: yes (Codex).
Imported from boykopovar/AnyPS5. Originally posted by Recapi on 2026-10-11T22:31:19Z.
Linux result for this PR, with a gap that the Windows run can't show.
Setup: Ubuntu (GNOME, Wayland, so SDL runs through XWayland), GCC, Release, NVIDIA RTX 2080 SUPER, monitor at 143.86 Hz. Local merge of
main8fc53cbwith this PR and #3840 (fcntl). Yamagi Quake II (PPSA99007, catalog 0.2.0-alpha.1),param.jsonattribute30x80040.The gap. With this PR merged, Quake II still logged
[ps5-output-mode] target=120 support=80290016and stopped before its first frame. The bundled SDL reports the display's refresh rate as 0 on Linux unless it was built with XRandR. Herelibxrandr-devwas missing, soSDL_VIDEO_DRIVER_X11_XRANDRwas not defined (theSDL_X11_XRANDRoption is ON), andGetDisplayRefreshRate()read 0. A probe linked against the samelibSDL2.a:With XRandR, Quake II gets
support=00000001 preset=00000000 result=00000000andpresent-open. The menu draws, and it presents 960 frames in about 37 s at 120 Hz pacing. Then it hits the P20 case of #1413:last provoking vertex with explicit per-vertex flat interpolation is unsupported, the same stop @PrintOrb saw on Windows. #4030 doesn't cover it (P10 only).So on Linux, this PR depends on SDL's XRandR support, and neither
docs/dev/BUILD.mdnor the Linux CI job installslibxrandr-dev(CI installs only the three audio packages). Two small additions would close the gap:libxrandr-dev(Fedora:libXrandr-devel) todocs/dev/BUILD.mdand the Linux job;updateDisplayRefreshRatethrow on a refresh rate of 0 instead of taking it as "below 120 Hz". As it stands, a build without the package silently refuses 120 Hz on any monitor.Imported from boykopovar/AnyPS5. Originally posted by PrintOrb on 2026-10-11T22:53:43Z.
@Recapi thanks for the Linux reproduction. Could you verify commit
5c19601a1on your Linux setup? In separate clean bundled-SDL configure directories, please confirm that missing XRandR development files (or SDL_X11_XRANDR=OFF) fail with the new diagnostic, while installed/enabled XRandR configures successfully. Then please rerun the focused tests and Quake II startup to confirm it still reaches the menu and the known P20 stop. Linux verification of this follow-up is pending; my guard harness and Windows results are below.Implemented the configure-time approach from your report in
5c19601a1.Verification: the actual new CMake gate, extracted into a local directory-property harness, passes with the SDL capability true and rejects both false and unset with the expected message. This is a guard smoke test, not a native Linux build; this machine has no Linux environment.
Windows 11 / WinLibs GCC 15.2 r7: the Release libs build and five focused tests pass, including video_out_output_mode_policy, guest_video_out_high_frame_rate, guest_video_out_output_mode, param_json_parser and param_json_utf8. Native timing for 60 vblanks was 1.001 s default, 0.500 s high and 1.001 s restored. Two offscreen flip tests skipped because that SDL driver lacks Vulkan. Conventions, test registration and diff checks pass.
The Windows build/test comparison includes the existing #4021 fix for main's unrelated HostPoll compile failure. That commit is isolated on a local test branch and is not part of this PR update. Full CTest, Linux runtime and Quake II gameplay were not rerun.
AI-assisted: yes (Codex).
Imported from boykopovar/AnyPS5. Originally posted by Recapi on 2026-10-12T00:08:33Z.
@PrintOrb verified
5c19601a1on Linux: Ubuntu, GCC, Release, NVIDIA RTX 2080 SUPER, 143.86 Hz monitor, SDL on X11 through XWayland. Each configure was in its own clean build directory with the bundled SDL:-DSDL_X11_XRANDR=OFF: configure fails atCMakeLists.txt:118with the new message (SDL has no XRandR support, so X11 display refresh rates cannot be queried. Install libxrandr-dev ...).libxrandr-devinstalled: configure succeeds andSDL_VIDEO_DRIVER_X11_XRANDRis defined.SDL_VIDEO_DRIVER_X11_XRANDReven with the option ON. That is the state the new check catches throughHAVE_X11_XRANDR.The focused tests on the PR head pass 3/3 (
--repeat until-fail:3):video_out_output_mode_policy,guest_video_out_high_frame_rate,guest_video_out_resolution_status,guest_video_out_output_modeandparam_json_parser.guest_video_out_high_frame_rateran and was not skipped.Quake II (PPSA99007, catalog 0.2.0-alpha.1), relinked and run against the PR head alone:
[ps5-output-mode] target=120 support=00000001 preset=00000000 vrr=ffffffff result=00000000[ps5-agc] present-open handle=00000001 framebuffer=0x208200000/67108864 buffers=2 alias=0presentation failed: AGC graphics: last provoking vertex with explicit per-vertex flat interpolation is unsupported.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T19:32:30Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main).github/workflows/build.ymlL242-243.github/workflows/release.ymlL65docs/dev/BUILD.mdL29-30docs/dev/BUILD.mdL29core/libs/prx/libkernel/AppMetadata/include/ParamJsonParser.hppL11core/libs/prx/libkernel/AppMetadata/src/ParamJsonParser.cppL307core/libs/prx/libkernel/AppMetadata/include/AppMetadata.hppL25core/libs/prx/libkernel/AppMetadata/include/ParamJsonParser.hppL11core/libs/prx/libkernel/AppMetadata/src/AppMetadata.cppL91core/libs/tests/ParamJsonParser.cppL158Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T20:23:28Z.
Review: APPROVED
Re-checked the new head (XRandR configure gate,
libxrandr-devin both workflows and BUILD.md): built on current main with the full ctest run (979 passed), includingvideo_out_output_mode_policy,param_json_parserandguest_video_out_output_mode. @Recapi's Linux run covers the configure failure withSDL_X11_XRANDR=OFFandguest_video_out_high_frame_raterunning unskipped on a 144 Hz display. Merging.