Enable OpenGL compositing by default with R600/R700 cards and Mesa 7.7+.

svn path=/trunk/KDE/kdebase/workspace/; revision=1058207
This commit is contained in:
Fredrik Höglund 2009-12-04 08:58:54 +00:00
parent 868e08f380
commit 37fbc26205
2 changed files with 39 additions and 1 deletions

View file

@ -289,6 +289,32 @@ void CompositingPrefs::detectDriverAndVersion()
#endif
}
void CompositingPrefs::parseMesaVersion( const QString &version, int *major, int *minor )
{
*major = 0;
*minor = 0;
const QStringList tokens = version.split( ' ' );
int token = 0;
while( token < tokens.count() && !tokens.at( token ).endsWith( "Mesa" ) )
token++;
if( token < tokens.count() - 1 )
{
const QStringList version = tokens.at( token + 1 ).split( '.' );
if( version.count() >= 2 )
{
*major = version[ 0 ].toInt();
int end = 0;
while( end < version[ 1 ].length() && version[ 1 ][ end ].isDigit() )
end++;
*minor = version[ 1 ].left( end ).toInt();
}
}
}
// See http://techbase.kde.org/Projects/KWin/HW for a list of some cards that are known to work.
void CompositingPrefs::applyDriverSpecificOptions()
{
@ -327,7 +353,7 @@ void CompositingPrefs::applyDriverSpecificOptions()
}
}
else if( mDriver == "radeon" )
{ // radeon r200 only ?
{
if( mGLRenderer.startsWith( "Mesa DRI R200" ) && mVersion >= Version( "20060602" )) // krazy:exclude=strings
{
kDebug( 1212 ) << "radeon r200 >= 20060602, enabling compositing";
@ -338,6 +364,17 @@ void CompositingPrefs::applyDriverSpecificOptions()
kDebug( 1212 ) << "radeon r300 >= 20090101, enabling compositing";
mEnableCompositing = true;
}
if( mGLRenderer.startsWith( "Mesa DRI R600" ) )
{
// Enable compositing with Mesa 7.7 or later
int major, minor;
parseMesaVersion( mGLVersion, &major, &minor );
if( major > 7 || ( major == 7 && minor >= 7 ) )
{
kDebug( 1212 ) << "Radeon R600/R700, Mesa 7.7 or better. Enabling compositing.";
mEnableCompositing = true;
}
}
}
else if( mDriver == "fglrx" )
{ // radeon r200 only ?

View file

@ -69,6 +69,7 @@ public:
protected:
void detectDriverAndVersion();
void parseMesaVersion( const QString &version, int *major, int *minor );
void applyDriverSpecificOptions();
static bool detectXgl();