diff options
author | Nicholas Kazlauskas <[email protected]> | 2018-10-23 11:38:51 -0400 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2018-12-28 16:44:47 +0100 |
commit | 2e12fe425fe35d2c72ce0dbffa826f0098fdac2e (patch) | |
tree | 9b759b8a5a0f305a2a77835021cbe87e92f0ce67 /src/loader/loader_dri3_helper.h | |
parent | a9c36dbf9c56b0d8b3810f7c95d44202bf79dac7 (diff) |
loader/dri3: Enable adaptive_sync via _VARIABLE_REFRESH property
The DDX driver can be notified of adaptive sync suitability by
flagging the application's window with the _VARIABLE_REFRESH property.
This property is set on the first swap the application performs
when adaptive_sync is set to true in the drirc.
It's performed here instead of when the loader is initialized for
two reasons:
(1) The window's drawable can be missing during loader init.
This can be observed during the Unigine Superposition benchmark.
(2) Adaptive sync will only be enabled closer to when the application
actually begins rendering.
If adaptive_sync is false then the _VARIABLE_REFRESH property
is deleted on loader init.
The property is only managed on the glx DRI3 backend for now. This
should cover most common applications and games on modern hardware.
Vulkan support can be implemented in a similar manner but would likely
require splitting the function out into a common helper function.
Reviewed-by: Michel Dänzer <[email protected]>
Signed-off-by: Nicholas Kazlauskas <[email protected]>
Diffstat (limited to 'src/loader/loader_dri3_helper.h')
-rw-r--r-- | src/loader/loader_dri3_helper.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/loader/loader_dri3_helper.h b/src/loader/loader_dri3_helper.h index 0d181813126..663ce3c0e2f 100644 --- a/src/loader/loader_dri3_helper.h +++ b/src/loader/loader_dri3_helper.h @@ -156,6 +156,8 @@ struct loader_dri3_drawable { xcb_special_event_t *special_event; bool first_init; + bool adaptive_sync; + bool adaptive_sync_active; int swap_interval; struct loader_dri3_extensions *ext; |