Commit graph

25 commits

Author SHA1 Message Date
Joshua Ashton
1594e02c84 vblankmanager: Discard first non-missed frames after a missed frame
Additionally fix some vblank limiting stuff for FSR at 4K.

This is our late frame.
2022-02-13 09:16:10 +00:00
Joshua Ashton
8fe9322578 vblankmanager: Explain divergence situation in a comment 2022-02-12 18:24:12 +00:00
Joshua Ashton
e690b00f7b vblankmanager: Allow going back in time by fixed redzones
Going back a little bit okay, it's when we use varying values to go back, we become divergent from target over time with varying clocks
2022-02-12 18:13:45 +00:00
Joshua Ashton
f156763458 vblankmanager: Don't sleep back in time
Fixes getting stuck in a feedback loop with high variance
2022-02-12 17:59:20 +00:00
Joshua Ashton
2cac416000 vblankmanager: When calculating fps limiter sleep time, take the min of the rolling max frame time against target interval - redzone
We account for redzone later, and don't want to go over vblank time and preceed into previous vblank or whatever here.
2022-02-12 13:46:36 +00:00
Joshua Ashton
29060cc87c steamcompmgr: Detect stalls in fps limiter latent buffer heuristic 2022-02-12 12:11:00 +00:00
Joshua Ashton
a5c660e54f vblankmanager: More value tuning
Based on some rough data across a variety of games that are both GPU bound and also ones that are very not and cause GPU clocks to vary wildly
2022-02-12 11:54:51 +00:00
Joshua Ashton
e53f986048 vblankmanager: Tune FPS limiter and dynamic vblank heuristics 2022-02-11 05:28:03 +00:00
Joshua Ashton
d759bd5efd vblankmanager: Fix shutting down fps limiter thread
Closes: #406
2022-02-10 02:34:03 +00:00
Joshua Ashton
c5ab6f388b vblankmanager: Implement FPS limiter by strategic buffer withholding 2022-02-09 00:34:58 +00:00
Joshua Ashton
0bc3a2493d steamcompmgr: Add tuneables for vblank red zone + decay rate 2022-01-31 23:49:39 +00:00
Joshua Ashton
797ee59cbb vblankmanager: Estimate draw buffer time based on max rolling average draw time
Handles spikes much better and allows us to have a lower buffer when not needed.
2022-01-31 23:49:39 +00:00
Joshua Ashton
a659fef806 drm: Use vblank time from page flip handler 2022-01-31 23:49:39 +00:00
Simon Ser
f3865a73bd Name our threads
Unfortunately the name length is limited to 15 characters, and the
executable name is dropped from the name if we don't include it.
2021-10-27 17:18:29 +02:00
Simon Ser
470756029d Stop using X11 events for vblankmanager
Instead, use a pipe. Check if the pipe is readable in the
steamcompmgr event loop.

This avoids a roundtrip through the X11 server.

Closes: https://github.com/Plagman/gamescope/issues/201
2021-06-09 18:42:38 +02:00
Pierre-Loup A. Griffais
2bb4907993 Also spew wayland display name through session pipe. 2021-04-27 21:17:36 -07:00
Simon Ser
29d00dbc68 tracing: use {begin,end}_ctx helpers, remove unnecessary newlines 2021-03-11 11:25:34 +01:00
Pierre-Loup A. Griffais
fd7a81547a vblankmanager: obey nested refresh rate if set 2020-09-15 14:46:12 -07:00
Joshua Ashton
9af5c3f254 Cleanup vblankmanager
Keep everything on the same timescale.
Avoid using floats here when we can just use integer maths.
Add demarcations.
Misc. cleanup.
2020-09-12 22:26:31 -07:00
Joshua Ashton
bb9d0cdf8f Use nanoseconds for vblank timing
Avoids locking on-vblank
STL's clock's accuracy can be funky also.
2020-09-12 22:26:31 -07:00
Joshua Ashton
50a508ae74 Encode vblank time in client message
Eliminates the atomic hack here
2020-09-12 22:26:31 -07:00
Pierre-Loup A. Griffais
81b8e8c33c steamcompmgr: ignore vblank messages if we get them too late. 2020-09-01 22:59:44 -07:00
Simon Ser
bae255ee1a
Get rid of C_SIDE
wlroots headers can mostly be included with extern "C" blocks. Two
exceptions are the use of `static` for array args and `class` as a
struct field. These can be #define'ed to avoid C++ build errors.

This allows the whole project to be built as a single C++ codebase,
without having to maintain hybrid header files.
2020-06-11 12:44:36 +02:00
Pierre-Loup A. Griffais
b4893840eb vblank: more tweaks, align to DRM vblank. 2020-01-26 16:28:35 -08:00
Pierre-Loup A. Griffais
4ca73da9f6 vblankmanager: initial system to let steamcompmgr know when to repaint
For now just mark one repaint per refresh interval without any particular
alignment, as that can be hard to get in nested. We'll use the display
timing extensions for that later.

We'll have it align properly in embedded mode soon.
2020-01-26 14:59:51 -08:00