From 595f6a8b99a84efb0d6f9f1c3bb2b6a256c543ee Mon Sep 17 00:00:00 2001 From: drago01 Date: Sun, 15 Mar 2009 10:32:47 +0000 Subject: [PATCH] Use direct rendering if the driver supports it (DRI2) --- compiz-gtk | 28 +++++++++++++++++++++------- compiz.spec | 14 +++++++------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/compiz-gtk b/compiz-gtk index 99659fa..2b3a427 100644 --- a/compiz-gtk +++ b/compiz-gtk @@ -1,11 +1,25 @@ -#!/bin/sh -export LIBGL_ALWAYS_INDIRECT=1 +#!/bin/bash -/usr/bin/glx_tfp_test - -if [ $? -eq 0 ]; then +function runCompiz() { gtk-window-decorator & exec compiz --ignore-desktop-hints glib gconf $@ -else - exec metacity $@ +} + +HAVE3D=`glxinfo | grep "direct rendering: " | head -n 1 | cut -d " " -f 3` +HAVETFP=`glxinfo | grep texture_from_pixmap -c` + +if ( [ $HAVE3D == "Yes" ] && [ $HAVETFP -gt 2 ] ); then + runCompiz fi + +# Try again with indirect rendering +export LIBGL_ALWAYS_INDIRECT=1 + +HAVETFP=`glxinfo | grep texture_from_pixmap -c` + +if ( [ $HAVE3D == "Yes" ] && [ $HAVETFP -gt 2 ] ); then + runCompiz +fi + +# Fall back to metacity +exec metacity $@ diff --git a/compiz.spec b/compiz.spec index f762687..33d1580 100644 --- a/compiz.spec +++ b/compiz.spec @@ -14,7 +14,7 @@ URL: http://www.go-compiz.org License: GPLv2+ and LGPLv2+ and MIT Group: User Interface/Desktops Version: 0.7.8 -Release: 14%{?dist} +Release: 15%{?dist} Summary: OpenGL window and compositing manager BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -24,7 +24,8 @@ ExcludeArch: s390 s390x Conflicts: xorg-x11-server-Xorg < 1.3.0.0-19.fc8 Requires: mesa-libGL >= 7.0.1-2.fc8 -Requires: system-logos +Requires: system-logos +Requires: glx-utils Requires(post): desktop-file-utils BuildRequires: libX11-devel, libdrm-devel, libwnck-devel @@ -48,7 +49,6 @@ Source1: desktop-effects-%{dialogversion}.tar.bz2 Source2: kde-desktop-effects-%{kde_dialogversion}.tar.bz2 Source3: compiz-gtk Source4: compiz-gtk.desktop -Source5: glx_tfp_test.c # Make sure that former beryl users still have bling Obsoletes: beryl-core @@ -204,9 +204,6 @@ export LDFLAGS make %{?_smp_mflags} imagedir=%{_datadir}/pixmaps -# glx_tfp_test -gcc %{SOURCE5} -lX11 -lGLU $RPM_OPT_FLAGS -o glx_tfp_test - # desktop-effects cd ../desktop-effects-%{dialogversion} %configure @@ -352,7 +349,6 @@ rm -rf $RPM_BUILD_ROOT %files gnome -f gnome-files.txt %defattr(-, root, root) %{_bindir}/compiz-gtk -%{_bindir}/glx_tfp_test %{_bindir}/gtk-window-decorator %{_bindir}/desktop-effects %{_libdir}/window-manager-settings/libcompiz.so @@ -393,6 +389,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sun Mar 15 2009 Adel Gadllah - 0.7.8-15 +- Improved tfp check, fixes "white screen of death" +- Use direct rendering if the driver supports it (DRI2) + * Sat Feb 28 2009 Adel Gadllah - 0.7.8-14 - Backport gwd fix from upstream, should fix RH #484056