summaryrefslogtreecommitdiffstats
path: root/test/glx_test.sh
diff options
context:
space:
mode:
authorDexter Morgan <dmorgan@mageia.org>2011-06-02 20:52:55 +0000
committerDexter Morgan <dmorgan@mageia.org>2011-06-02 20:52:55 +0000
commitb551e9315f5e1e6c687fc2dfa90595a2ab3caecd (patch)
tree7f21dfab4b512f626906f7d0825bef5891c1e57b /test/glx_test.sh
downloaddrak3d-distro/mga1.tar
drak3d-distro/mga1.tar.gz
drak3d-distro/mga1.tar.bz2
drak3d-distro/mga1.tar.xz
drak3d-distro/mga1.zip
Branch for updatesdistro/mga1
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"