[Xfce4-commits] [xfce/xfwm4] 01/01: compositor: Smarter vblank auto mode
noreply at xfce.org
noreply at xfce.org
Sun Apr 12 09:58:05 CEST 2020
This is an automated email from the git hooks/post-receive script.
o l i v i e r p u s h e d a c o m m i t t o b r a n c h x f c e - 4 . 1 4
in repository xfce/xfwm4.
commit c5f4e10d5d72de4839ea92ce8734d5b7d68a8b9b
Author: Olivier Fourdan <fourdan at xfce.org>
Date: Sat Apr 11 18:55:36 2020 +0200
compositor: Smarter vblank auto mode
With vblank mode set to auto (default), use the GL renderer to select
XPresent on Intel and AMD if available.
Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
(cherry picked from commit 23900123ad8418149897a094d1096d6ecb984d3c)
---
src/compositor.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/src/compositor.c b/src/compositor.c
index 2e58a2d..5cafb7d 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1064,6 +1064,14 @@ check_glx_renderer (ScreenInfo *screen_info)
"SVGA3D",
NULL
};
+#if HAVE_PRESENT_EXTENSION
+ const char *prefer_xpresent[] = {
+ "Intel",
+ "AMD",
+ NULL
+ };
+#endif /* HAVE_PRESENT_EXTENSION */
+
int i;
g_return_val_if_fail (screen_info != NULL, FALSE);
@@ -1086,6 +1094,20 @@ check_glx_renderer (ScreenInfo *screen_info)
return FALSE;
}
+#if HAVE_PRESENT_EXTENSION
+ if (screen_info->vblank_mode == VBLANK_AUTO)
+ {
+ i = 0;
+ while (prefer_xpresent[i] && !strcasestr (glRenderer, prefer_xpresent[i]))
+ i++;
+ if (prefer_xpresent[i])
+ {
+ g_warning ("Prefer XPresent with %s", glRenderer);
+ return FALSE;
+ }
+ }
+#endif /* HAVE_PRESENT_EXTENSION */
+
return TRUE;
}
@@ -1357,7 +1379,6 @@ init_glx (ScreenInfo *screen_info)
if (!check_glx_renderer (screen_info))
{
- g_warning ("Screen is missing required GL renderer, GL support disabled.");
free_glx_data (screen_info);
return FALSE;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list