Skip to content
Snippets Groups Projects
  • Olivier Fourdan's avatar
    d5222bcf
    compositor: Force "GL_MaxFramesAllowed" to 1 · d5222bcf
    Olivier Fourdan authored
    Bug: 15453
    
    NVIDIA proprietary/closed source driver queues up to 2 frames by default
    before blocking in glXSwapBuffers(), whereas our compositor expects
    `glXSwapBuffers()` to block until the next vblank.
    
    To avoid that, our compositor is issuing a `glXWaitGL()` immediately
    after the call to `glXSwapBuffers()` but that translates as a busy wait,
    hence dramatically increasing CPU usage of xfwm4 with the NVIDIA
    proprietary/closed source driver.
    
    Instruct the NVIDIA proprietary/closed source driver to allow only 1
    frame using the environment variable “__GL_MaxFramesAllowed” so that it
    matches our expectations.
    
    Taken from similar patch posted by NVIDIA developer for kwin:
    https://phabricator.kde.org/D19867
    
    
    
    Signed-off-by: default avatarOlivier Fourdan <fourdan@xfce.org>
    d5222bcf
    History
    compositor: Force "GL_MaxFramesAllowed" to 1
    Olivier Fourdan authored
    Bug: 15453
    
    NVIDIA proprietary/closed source driver queues up to 2 frames by default
    before blocking in glXSwapBuffers(), whereas our compositor expects
    `glXSwapBuffers()` to block until the next vblank.
    
    To avoid that, our compositor is issuing a `glXWaitGL()` immediately
    after the call to `glXSwapBuffers()` but that translates as a busy wait,
    hence dramatically increasing CPU usage of xfwm4 with the NVIDIA
    proprietary/closed source driver.
    
    Instruct the NVIDIA proprietary/closed source driver to allow only 1
    frame using the environment variable “__GL_MaxFramesAllowed” so that it
    matches our expectations.
    
    Taken from similar patch posted by NVIDIA developer for kwin:
    https://phabricator.kde.org/D19867
    
    
    
    Signed-off-by: default avatarOlivier Fourdan <fourdan@xfce.org>