[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/kwin/lib
From:       Fredrik Höglund <fredrik () kde ! org>
Date:       2010-12-03 23:26:30
Message-ID: 20101203232630.59C40AC8A4 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1203427 by fredrik:

Add detection for GeForce GPUs with the NVIDIA driver.

 M  +54 -4     kwinglplatform.cpp  


--- trunk/KDE/kdebase/workspace/kwin/lib/kwinglplatform.cpp #1203426:1203427
@@ -232,7 +232,7 @@
 
 static ChipClass detectNVidiaClass(const QString &chipset)
 {
-    const QString name = extract(chipset, "\\bNV[0-9,A-C]{2,2}\\b"); // NV followed \
by two hexadecimal digits +    QString name = extract(chipset, \
"\\bNV[0-9,A-F]{2}\\b"); // NV followed by two hexadecimal digits  if \
(!name.isEmpty())  {
         const int id = chipset.mid(2, -1).toInt(0, 16); // Strip the 'NV' from the \
id @@ -264,9 +264,61 @@
        }
     }
 
+    if (chipset.contains("GeForce2") || chipset.contains("GeForce 256"))
+        return NV10;
+
+    if (chipset.contains("GeForce3"))
+        return NV20;
+
+    if (chipset.contains("GeForce4")) {
+        if (chipset.contains("MX 420")  ||
+            chipset.contains("MX 440")  || // including MX 440SE
+            chipset.contains("MX 460")  ||
+            chipset.contains("MX 4000") ||
+            chipset.contains("PCX 4300"))
+            return NV10;
+
+        return NV20;
+    }
+
+    // GeForce 5,6,7,8,9
+    name = extract(chipset, "GeForce (FX |PCX |Go )?\\d{4}(M|\\b)").trimmed();
+    if (!name.isEmpty()) {
+        if (!name[name.length() - 1].isDigit())
+            name.chop(1);
+
+        const int id = name.right(4).toInt();
+        if (id < 6000)
+            return NV30;
+
+        if (id >= 6000 && id < 8000)
+            return NV40;
+
+        if (id >= 8000)
+            return G80;
+
     return UnknownNVidia;
 }
 
+    // GeForce 100/200/300/400/500
+    name = extract(chipset, "GeForce (G |GT |GTX |GTS )?\\d{3}(M|\\b)").trimmed();
+    if (!name.isEmpty()) {
+        if (!name[name.length() - 1].isDigit())
+            name.chop(1);
+
+        const int id = name.right(3).toInt();
+        if (id >= 100 && id < 600) {
+            if (id >= 400)
+                return GF100;
+
+            return G80;
+        }
+        return UnknownNVidia;
+    } 
+
+    return UnknownNVidia;
+}
+
 static ChipClass detectIntelClass(const QByteArray &chipset)
 {
     // GL 1.3, DX8? SM ?
@@ -584,7 +636,7 @@
     }
 
     else if (m_vendor == "NVIDIA Corporation") {
-        m_chipClass = UnknownNVidia;
+        m_chipClass = detectNVidiaClass(m_renderer);
         m_driver = Driver_NVidia;
     
         int index = versionTokens.indexOf("NVIDIA");
@@ -592,8 +644,6 @@
             m_driverVersion = parseVersionString(versionTokens.at(index + 1));
         else
             m_driverVersion = 0;
-
-        // TODO detect the chip class
     }
 
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic