Simplify repaint scheduling documentation

The current documentation for repaint scheduling is very technical and
somewhat confusing.

Closes: https://github.com/swaywm/sway/issues/4769
This commit is contained in:
Kenny Levinsen 2020-05-01 17:20:41 +02:00 committed by Simon Ser
parent b1d08db5f5
commit a8a6ed667d
2 changed files with 28 additions and 31 deletions

View file

@ -117,22 +117,17 @@ must be separated by one space. For example:
(ie. blank the screen but keep workspaces as-is), one can set DPMS to off. (ie. blank the screen but keep workspaces as-is), one can set DPMS to off.
*output* <name> max_render_time off|<msec> *output* <name> max_render_time off|<msec>
When set to a positive number of milliseconds, enables delaying output Controls when sway composites the output, as a positive number of
rendering to reduce latency. The rendering is delayed in such a way as milliseconds before the next display refresh. A smaller number leads to
to leave the specified number of milliseconds before the next fresher composited frames and lower perceived input latency, but if set too
presentation for rendering. low, sway may not finish compositing in time for display refresh, leading to
delayed frames.
The output rendering normally takes place immediately after a When set to off, sway composites immediately after display refresh,
presentation (vblank, buffer flip, etc.) and the frame callbacks are maximizing time available for compositing.
sent to surfaces immediately after the rendering to give surfaces the
most time to draw their next frame. This results in slightly below 2 To adjust when applications are instructed to render, see *max_render_time*
frames of latency between the surface rendering and committing new in *sway*(5).
contents, and the contents being shown on screen, on average. When the
output rendering is delayed, the frame callbacks are sent immediately
after presentation, and the surfaces have a small timespan (1 /
(refresh rate) - max_render_time) to render and commit new contents to
be shown on the next presentation, resulting in below 1 frame of
latency.
To set this up for optimal latency: To set this up for optimal latency:
. Launch some _full-screen_ application that renders continuously, like . Launch some _full-screen_ application that renders continuously, like
@ -140,14 +135,8 @@ must be separated by one space. For example:
. Start with *max_render_time 1*. Increment by *1* if you see frame . Start with *max_render_time 1*. Increment by *1* if you see frame
drops. drops.
To achieve even lower latency, see the *max_render_time* surface This setting only has an effect on Wayland and DRM backends, as support for
property in *sway*(5). presentation timestamps and predicted output refresh rate is required.
Note that this property has an effect only on backends which report the
presentation timestamp and the predicted output refresh rate—the DRM
and the Wayland backends. Furthermore, under the Wayland backend the
optimal max_render_time value may vary based on the parent compositor
rendering timings.
*output* <name> adaptive_sync on|off *output* <name> adaptive_sync on|off
Enables or disables adaptive synchronization (often referred to as Variable Enables or disables adaptive synchronization (often referred to as Variable

View file

@ -186,21 +186,29 @@ set|plus|minus <amount>
Cycles the layout mode of the focused container through a list of layouts. Cycles the layout mode of the focused container through a list of layouts.
*max_render_time* off|<msec> *max_render_time* off|<msec>
Works together with *output max_render_time* to reduce the latency even Controls when the relevant application is told to render this window, as a
further by delaying the frame callbacks sent to a surface. When set to positive number of milliseconds before the next time sway composites the
a positive number of milliseconds, delays the frame callback in such a output. A smaller number leads to fresher rendered frames being composited
way that the surface has the specified number of milliseconds to render by sway and lower perceived input latency, but if set too low, the
and commit new contents before being sampled by the compositor for the application may not finish rendering before sway composites the output,
next presentation. See *max_render_time* in *sway-output*(5) for leading to delayed frames.
further details.
When set to off, the relevant application is told to render this window
immediately after display refresh. How much time is left for rendering
before sway composites the output at that point depends on the output
*max_render_time* setting.
To set this up for optimal latency: To set this up for optimal latency:
. Set up *output max_render_time*. . Set up *output max_render_time* (see *sway-output*(5)).
. Put the target application in _full-screen_ and have it continuously . Put the target application in _full-screen_ and have it continuously
render something. render something.
. Start by setting *max_render_time 1*. If the application drops . Start by setting *max_render_time 1*. If the application drops
frames, increment by *1*. frames, increment by *1*.
This setting only has an effect if a per-output *max_render_time* is in
effect on the output the window is currently on. See *sway-output*(5) for
further details.
*move* left|right|up|down [<px> px] *move* left|right|up|down [<px> px]
Moves the focused container in the direction specified. If the container, Moves the focused container in the direction specified. If the container,
the optional _px_ argument specifies how many pixels to move the container. the optional _px_ argument specifies how many pixels to move the container.