Repository navigation
native: Keep framebuffers on screen while releasing them - #905
Open
SyberHexen wants to merge 1 commit into
Open
SyberHexen wants to merge 1 commit into
SyberHexen wants to merge 1 commit into
Conversation
Every monitor change destroys and recreates all views, so the scanout buffers of the monitors that stay connected are released too, while they are still on screen. drmModeRmFB() turns off whatever shows a framebuffer it removes, and amdgpu, which cannot disable a primary plane alone, turned off the whole CRTC: drm_framebuffer_remove: Disabling [CRTC:381:crtc-0] because [FB:447] is removed The monitor then stayed black for about 110 ms on every hotplug, until the new view set the CRTC again. Release framebuffers that may be on screen with drmModeCloseFB() (Linux 6.8, libdrm 2.4.117), which drops the handle and leaves the picture up until it is replaced, and fall back to drmModeRmFB() where it is missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes linuxmint/wayland#246.
Bug: every monitor change destroys and recreates all views, so the scanout buffers of the monitors that stay connected are released while still on screen.
drmModeRmFB()turns off whatever shows the framebuffer it removes; amdgpu can't disable a primary plane alone, so it turns off the whole CRTC (drm_framebuffer_remove: Disabling [CRTC:381:crtc-0] because [FB:447] is removedwith drm.debug). The monitors that stay connected go black for about 110 ms on every hotplug.Reproduce: Cinnamon Wayland session on amdgpu with two monitors; unplug or plug a third one (or switch an output off and on in Display settings): the other monitors blink black.
Fix: release framebuffers that may be on screen with
drmModeCloseFB()(Linux 6.8, libdrm 2.4.117), which drops the handle and leaves the picture up until it's replaced; fall back todrmModeRmFB()where it's missing (checked in meson).Tested: over repeated hotplugs a probe polling the CRTC state never saw it go off, and the monitors no longer blink; with an older libdrm the build takes the RmFB fallback.