Repository navigation
fix(videoout): keep the last display mode while the host reports no display - #25943
oneandonlydean merged 1 commit into
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The display mode fallback retains the last successfully measured values after SDL lookup failures, and the focused tests reported by the author cover the policy; I did not run checks in this review.
What I ran
Reviewed head 7859c5d74b1279894f35a79e41aeb6448117aaee using the prepared diff and pinned repository reader. No commands or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Diff and changed code review | passed | All five changed files read |
| Tests in this review | not run | Author reports focused tests passed |
Findings
Blocking
None.
Non-blocking
None.
Not verified
Builds and tests were not run. Runtime behavior on physical consoles and host display configurations beyond the author-reported Linux setup were not verified. No files were excluded from the prepared manifest; all five files marked for review were read.
To get this to a good state
Nothing is required.
|
Tested the patch from The focused CTests I also compiled each revision’s The disconnect and reconnect were simulated; the physical monitor remained connected. AI-assisted local verification (Codex). |
|
Run on Windows with an AMD GPU and the validation layer: the change looks correct. This is not a GPU result. The change is host-side SDL display handling, and the GPU is incidental to it:
On head What this run adds. Two reviews already exist:
The author ran Linux on an RTX 3080 Ti with DPMS tests. There, X kept both outputs listed, so the no-display path itself was never reached. Mine adds the following:
Code.
No-display injection (local, reverted). I replaced the
This simulates the loss only at the SDL lookup. The monitor stayed connected, and I did not test a real DisplayPort or HDMI drop. Negative control. GPU. Head
The four flip tests each selected Validation.
Host:
AI-assisted: yes |
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
What
The presenter calls
VideoOutDriver::updateDisplayRefreshRate()on every pass of its event loop. When SDL finds no display for the window, which happens while a monitor sleeps or drops its DisplayPort or HDMI link,SDL_GetWindowDisplayIndexfails, the function throws, and the presentation thread turns the exception intostd::terminate:A title that has been running for an hour stops this way when the monitor goes into power saving, for example during play with a controller only, since controller input does not keep the desktop's display awake.
The change:
updateDisplayRefreshRate()keeps the last measured refresh rate and resolution when the display index or the display mode cannot be read, and the title keeps running; the next successful read updates them again. When no mode was ever measured, it still stops with the same message, so a title started while the display sleeps behaves asdocs/dev/GAME_TESTING.mddescribes. The decision is a small function,KeepHostDisplayMode()inHostDisplayMode.hpp, so it can be tested without a display.Tested
Linux 7.3, RTX 3080 Ti, NVIDIA 615.71.09, Release.
main1ec0df1aee; the 16 commits in between do not touchlibSceVideoOut.video_out_host_display_mode: no display before any mode stops with the lookup failure; the first measured mode is taken; with no display afterwards the known mode is kept; a new measurement replaces it.^video_out_withANYPS5_VIDEO_OUT_TEST_DRIVER=x11,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -V, on this change onmain7dad980505and on thatmain: 46 of 46 and 45 of 45 pass, the loader inserted the layer 33 times in each log and never reported it missing, and neither log has aVUID-line.kscreen-doctor --dpms offfor 30 s and for 3 min, and the monitor's power button). In those tests the X server kept listing both outputs, so SDL never reported zero displays: the no-display path itself is covered by the new test, not by these runs.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)