Repository navigation
display(macOS): revert the display link and its follow-up fix (#7983, #8195) - #8205
Merged
Merged
Conversation
…ink draws" This reverts commit 9f10688 (utmapp#8195), a fix for the CAMetalDisplayLink of utmapp#7983, which is reverted next. Assisted-by: Claude:claude-opus-5-5
This reverts commit 216660f (utmapp#7983). Drawing from a CAMetalDisplayLink while MTKView still owns the drawing setup made the display blurry in 5.0.9 (utmapp#8191, fixed by utmapp#8195, reverted before this) and can crash at VM start when a draw MTKView's own timer queued asks the layer for a drawable while the link owns it (utmapp#8204). Each fix adds another override of MTKView's internals. Go back to MTKView's own timer: a window on a 120 Hz panel is again drawn at the main display's rate when that is a slower external display. Assisted-by: Claude:claude-opus-5-5
This was referenced Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #8195 and #7983. The QEMU display window on macOS goes back to drawing from MTKView's own timer, as in 5.0.8.
The maintainer has decided to revert these changes completely rather than ship another hot patch. @dragoshont, this concerns your #7983. Thank you for finding the 60 Hz cap and for the careful measurements in that PR. Two regressions got past several rounds of validation, one of them in an emergency release, and each fix added another override of MTKView's internals. So UTM will follow Apple's framework behavior here, even where that behavior is a framework bug, rather than maintain a workaround this fragile. If the remaining cap (below) affects you, please report it to Apple with Feedback Assistant as a MetalKit bug: MTKView's internal display link stays on the display that was main when the view was created, and doesn't follow the window to a faster screen.
Fixes #8204
What still works: 120 Hz is not gone
On a Mac with a 120 Hz ProMotion panel, VM windows are drawn at the full 120 Hz in the common setups:
Also unchanged from 5.0.8:
Where 120 Hz does not work after this revert
MTKView's timer stays on the display that was the main display when the VM window was created. So:
Two smaller behaviors also return to 5.0.8's:
History
All times UTC.
CAMetalDisplayLinkon macOS 14+, so a window on a 120 Hz panel is no longer held at a 60 Hz main display's rate.CAMetalDisplayLinkwithNSView.displayLink. Tested only with the built-in panel as the sole display.NSScreen.displayLink. Only a presentingCAMetalDisplayLink(#7983) reaches 120 Hz. #8199 closed.CAMetalLayerInvalidOperation: -nextDrawable should not be called when using CAMetalDisplayLink. Present since #7983, so in 5.0.9 too; reported on 5.0.9-1.Edge cases found and handled after #7983 was merged
NSView.displayLinkandNSScreen.displayLinkcapped at the main display's rate, just like MTKView's timer.CVDisplayLinkto the window's screen. It works, but it reads a private MTKView ivar and keeps drawing while hidden.The two regressions that got past validation
Testing
Tested by an AI agent on a MacBook Pro (Apple M2 Max), macOS 27.2, with its built-in 120 Hz ProMotion panel and a 1280x720 60 Hz external display. Guest: Ubuntu 26.04 arm64 on
virtio-gpu-gl-pci, booted disposable.Results on the code in this PR:
kmscuberan on its console. With the built-in panel as the only display, 120 fps reached the window (686 frames at 8.3 ms).The same code (with temporary counters, not committed) went through the 21-scenario comparison and the unplug test on 2026-11-18 as option "A". Every step drew at the view's pixel size (0 mismatches). It was capped at 60 Hz only when a 60 Hz external was the main display, and it recovered when the external display was unplugged and plugged back.