compositor: make XPresent VSync default Compared with GLX, XPresent is more performant, proven in testing with: nouveau, radeon and intel - can be tested with: $ LIBGL_DEBUG=verbose vblank_mode=0 glxgears using the following configuration: /etc/X11/xorg.conf.d/nouveau-dri3.conf Section "Device" Identifier "nvidia0" Driver "nouveau" Option "DRI" "3" EndSection Xorg.0.log: NOUVEAU(0): DRI3 on EXA enabled ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /etc/X11/xorg.conf.d/radeon-dri3.conf Section "Device" Identifier "amd0" Driver "radeon" Option "DRI3" "on" EndSection Xorg.0.log: RADEON(0): DRI3 enabled ~~~~~~~~~~~~~~~~~~~~~~~ /etc/X11/xorg.conf.d/intel-dri3.conf Section "Device" Identifier "intel0" Driver "intel" Option "DRI" "3" EndSection Xorg.0.log: intel(0): direct rendering: DRI2 DRI3 enabled ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In some cases, the user may prefer GLX over XPresent VSync, if both are present - can be checked with: $ xfwm4 --version An environment variable XFWM4_USE_PRESENT is for this purpose: $ XFWM4_USE_PRESENT=0 xfwm4 --replace & this will select GLX VSync even if XPresent is available. --- src/compositor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compositor.c b/src/compositor.c index dc45218..1bbae53 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -4351,14 +4351,14 @@ compositorManageScreen (ScreenInfo *screen_info) screen_info->texture_filter = GL_LINEAR; #ifdef HAVE_PRESENT_EXTENSION use_present_env = g_getenv ("XFWM4_USE_PRESENT"); - if (g_strcmp0 (use_present_env, "1") == 0) + if (g_strcmp0 (use_present_env, "0") == 0) { - screen_info->use_glx = FALSE; + screen_info->use_glx = init_glx (screen_info); } else #endif /* HAVE_PRESENT_EXTENSION */ { - screen_info->use_glx = init_glx (screen_info); + screen_info->use_glx = FALSE; } #else /* HAVE_EPOXY */ screen_info->use_glx = FALSE; -- 2.6.3