Bug 105963 - kcmopengl 3d card is always unkwnown
Summary: kcmopengl 3d card is always unkwnown
Status: RESOLVED FIXED
Alias: None
Product: kcontrol
Classification: Miscellaneous
Component: kcminfo (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Helge Deller
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-19 16:18 UTC by Ilya Korniyko
Modified: 2005-05-20 20:29 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch to fix it (990 bytes, patch)
2005-05-19 18:07 UTC, Ilya Korniyko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Korniyko 2005-05-19 16:18:02 UTC
Version:            (using KDE KDE 3.4.0)
Installed from:    Compiled From Sources
OS:                Linux

it is because of changed format of /proc/dri/0/name in newer Linux'es (X.org or new kernel matter?)

So the following line 
  QRegExp rx = QRegExp("\\bPCI:([0-9a-fA-F]:[0-9a-fA-F]:[0-9a-fA-F])\\b");

in file "kcontrol/info/opengl.cpp" in function "static bool get_dri_device()"

should be updated to allow wider format
Comment 1 Ilya Korniyko 2005-05-19 18:07:17 UTC
Created attachment 11106 [details]
patch to fix it
Comment 2 Helge Deller 2005-05-20 20:19:47 UTC
SVN commit 416133 by deller:

fix Bug 105963: kcmopengl 3d card is always unkwnown 
BUG:105963


 M  +7 -2      trunk/KDE/kdebase/kcontrol/info/opengl.cpp  


--- trunk/KDE/kdebase/kcontrol/info/opengl.cpp #416132:416133
@@ -109,10 +109,15 @@
     if (!line.isEmpty()) {
 	dri_info.module = line.mid(0, line.find(0x20));
 
-	QRegExp rx = QRegExp("\\bPCI:([0-9a-fA-F]:[0-9a-fA-F]:[0-9a-fA-F])\\b");
+	// possible formats, for regression testing
+	// line = " PCI:01:00:0";
+	// line = " pci:0000:01:00.0"
+	QRegExp rx = QRegExp("\\b[Pp][Cc][Ii][:]([0-9a-fA-F]+[:])?([0-9a-fA-F]+[:][0-9a-fA-F]+[:.][0-9a-fA-F]+)\\b");
 	if (rx.search(line)>0)	 {
-		dri_info.pci = rx.cap(1);
+		dri_info.pci = rx.cap(2);
 		int end = dri_info.pci.findRev(':');
+		int end2 = dri_info.pci.findRev('.');
+		if (end2>end) end=end2;
 		dri_info.pci[end]='.';
 
 		QString cmd = QString("lspci -m -v -s ") + dri_info.pci;
Comment 3 Helge Deller 2005-05-20 20:29:07 UTC
committed to KDE 3.4 branch as well (svn commit #416134).
Thanks for the bug report & patch!