Skip to content

Fix display cadence refresh on monitor moves - #288

Merged
mstan merged 1 commit into
masterfrom
fix/issue-278-display-cadence
Sep 1, 2026
Merged

Fix display cadence refresh on monitor moves#288
mstan merged 1 commit into
masterfrom
fix/issue-278-display-cadence

Conversation

@mstan

@mstan mstan commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • keep guest cadence separate from the host-synced effective frame period
  • re-probe the SDL window current display during runtime so monitor moves or display-mode changes reapply the present cadence decision
  • add a mixed-refresh cadence guard and update the PAL host-refresh guard

Fixes #278.

Notes

GitHub #278 is accurate for the reported build/logs where driver vsync could be treated as the sole cadence owner. On current master, present_should_wall_pace() already runs a wall-clock deadline cap even when driver vsync owns cadence, so this stale-display bug should not produce unbounded 200% RT there. The remaining current-master bug is stale display identity/refresh causing stale swap/present mode and a host-adjusted effective period until the runtime is restarted.

Test

  • python runtime/tests/test_pal_cadence_host_refresh.py
  • python runtime/tests/test_mixed_refresh_display_cadence.py
  • python runtime/tests/test_present_skip_cadence_guard.py
  • ctest registered guards passed for present_skip_cadence_guard_test, pal_cadence_host_refresh_test, mixed_refresh_display_cadence_test

Build verification

  • Configured a minimal SDL2 runtime build with PSX_REWIND=OFF, PSXRECOMP_ALLOW_NO_BIOS=ON, and PSX_RECOMP_UI=OFF.
  • Full compile was blocked by the local MSYS include environment, which failed to find SDL.h/stdlib.h before this change could be isolated further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Present cadence latched from the wrong display on mixed-refresh multi-monitor hosts (guest runs at 200%)

1 participant