mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-15 08:22:07 -04:00
wlr_scene: fix fullscreen app stuttering when screensharing
Problem: The wlroots implementation of wlr_screencopy applys a lock for a brief duration every time a frame is captured. If an output is eligible for direct scanout then this will result in direct scanout being rapidly toggled on and off since the lock count constantly flips between 0 and 1. On some hardware this causes stuttering every time direct scanout is enabled then disabled. Solution: To mitigate this we wait for there to be 0 locks for 120 frames so that we can be relatively confident that screen recording has stopped before we re-enable direct scanout.
This commit is contained in:
parent
19c5d22beb
commit
06d3d48aa2
3 changed files with 20 additions and 1 deletions
|
|
@ -248,6 +248,8 @@ struct wlr_output {
|
|||
|
||||
int attach_render_locks; // number of locks forcing rendering
|
||||
|
||||
int frames_since_locked;
|
||||
|
||||
struct wl_list cursors; // wlr_output_cursor.link
|
||||
struct wlr_output_cursor *hardware_cursor;
|
||||
struct wlr_swapchain *cursor_swapchain;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue