summaryrefslogtreecommitdiffstats
path: root/test/glx_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/glx_test.sh')
-rwxr-xr-xtest/glx_test.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/glx_test.sh b/test/glx_test.sh
new file mode 100755
index 0000000..55c3104
--- /dev/null
+++ b/test/glx_test.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+XGL=no
+COMPIZ=no
+# auto-start Xgl if direct rendering is available
+# and GLX_EXT_texture_from_pixmap is not available in server GLX extensions
+# (displayed before client glx extensions by glxinfo)
+glxinfo 2>/dev/null | awk 'BEGIN { no_direct = 1; in_client = 0; server_tfp = 0; client_tfp = 0 } /direct rendering: Yes/ { no_direct = 0 } /GLX_EXT_texture_from_pixmap/ { if (in_client) { client_tfp = 1 } else { server_tfp = 1 } } /client glx extensions:/ { in_client = 1 } /GLX extensions/ { exit } END { exit or(no_direct, and(server_tfp, client_tfp)) }' && XGL=yes
+# auto-start compiz if direct rendering and GLX_EXT_texture_from_pixmap are available
+source /etc/init.d/functions
+if [ "$XGL" = "yes" ] || pidof Xgl >/dev/null 2>&1; then
+ COMPIZ=yes
+elif glxinfo 2>/dev/null | awk 'BEGIN { no_direct = 1; no_tfp = 1 } /direct rendering: Yes/ { no_direct = 0 } /GLX_EXT_texture_from_pixmap/ { no_tfp = 0 } END { exit or(no_direct, no_tfp) }'; then
+ COMPIZ=yes
+fi
+echo "Xgl auto: $XGL"
+echo "Compiz auto: $COMPIZ"