perf(linux): capture wlr screencopy frames with damage - #5748
pablo-tech wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…n damage Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
|
Tested this on real hardware (hardware encoding, not llvmpipe) and it helps there too. Setup
Build Results (Moonlight connected)
With stock wlr capture the stream stays pinned at 60 FPS whatever is on screen, so No crashes or stalls in my session: the stream started normally, the cursor was drawn, and it returned to 60 FPS as soon as content changed. (Edited: my first version blamed the remaining ~20 FPS on a bar widget. That was wrong. My workspace switch had silently failed, so those readings came from a terminal that was actively updating. On a truly static workspace it drops to ~1 FPS as expected.) |
|
The
On a real idle stream the same kind of unattributed growth filled a 12 GB card until NVENC failed; I believe it was this mechanism, but I only reproduced it outside Sunshine. Details are in #5810. Together with #5764, which closes the leaked render-node fd, this looks likely to fix the DPMS-off case in #5810. |



Description
Captures wlr screencopy frames with damage instead of on request.
What changes
zwlr_screencopy_frame_v1_copy→zwlr_screencopy_frame_v1_copy_with_damage(src/platform/linux/wayland.cpp).snapshot()insrc/platform/linux/wlgrab.cppno longer requests a new frame while one is still pending, via the newwl::should_request_frame().tests/unit/platform/linux/test_wayland.cpp) and one docs sentence (docs/configuration.md).Why
src/protocols/Screencopy.cpp:127-128).Measured (Hyprland 0.56.2, llvmpipe, 1920x1080, Azure NV6ads A10 v5, Moonlight connected, idle screen)
some avg10)With no client connected Hyprland sat at 0-1%, which isolates the cost to the capture.
Tested
should_request_frameto always returntruefailsWaitsOnAFramePendingDamage.Scope
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage
See our AI usage policy.