summaryrefslogtreecommitdiffstats
path: root/test/glx_test.sh
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-06-07 21:11:56 +0000
committerThierry Vignaud <tv@mandriva.org>2007-06-07 21:11:56 +0000
commit9e2f460998c85976f00f6f5d75a0098155ba196c (patch)
tree650689ebf9b24c42fda353bbaed40bc93a6f4ad6 /test/glx_test.sh
parent8f3f6121feee52bed602842f953df78d3c30135a (diff)
downloaddrak3d-9e2f460998c85976f00f6f5d75a0098155ba196c.tar
drak3d-9e2f460998c85976f00f6f5d75a0098155ba196c.tar.gz
drak3d-9e2f460998c85976f00f6f5d75a0098155ba196c.tar.bz2
drak3d-9e2f460998c85976f00f6f5d75a0098155ba196c.tar.xz
drak3d-9e2f460998c85976f00f6f5d75a0098155ba196c.zip
reimport from latest checkout
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"