diff options context: 1 2 3 4 5 6 7 8 9 10 15 20 25 30 35 40 space: include ignore mode: unified ssdiff stat only

author Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> 2018-10-23 11:38:51 -0400 committer Michel Dänzer <michel@daenzer.net> 2018-12-28 16:44:47 +0100 commit 2e12fe425fe35d2c72ce0dbffa826f0098fdac2e (patch) tree 9b759b8a5a0f305a2a77835021cbe87e92f0ce67 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 <michel.daenzer@amd.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

2 files changed, 49 insertions, 1 deletions