Skip to content
  • Nicholas Kazlauskas's avatar
    loader/dri3: Enable adaptive_sync via _VARIABLE_REFRESH property · 2e12fe42
    Nicholas Kazlauskas authored and Michel Dänzer's avatar Michel Dänzer committed
    
    
    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: default avatarMichel Dänzer <michel.daenzer@amd.com>
    Signed-off-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
    2e12fe42