[Uludag-commits] r15301 - trunk/staj-projeleri/zorg/zorg

uludag-commits at pardus.org.tr uludag-commits at pardus.org.tr
5 Eyl 2007 Çar 10:59:45 EEST


Author: fatih
Date: Wed Sep  5 10:59:45 2007
New Revision: 15301

Modified:
   trunk/staj-projeleri/zorg/zorg/probe.py
Log:
Log parsing code for ATI proprietary driver


Modified: trunk/staj-projeleri/zorg/zorg/probe.py
=================================================================
--- trunk/staj-projeleri/zorg/zorg/probe.py	(original)
+++ trunk/staj-projeleri/zorg/zorg/probe.py	Wed Sep  5 10:59:45 2007
@@ -336,7 +336,66 @@
                     parsingModesFor = ""
 
 def queryFglrxOutputs(device):
-    pass
+    lines = xserverProbe(device)
+    if not lines:
+        return
+
+    device.tvStandards = [
+            "NTSC-M",       "NTSC-JPN", "NTSC-N",      "PAL-B",
+            "PAL-COMB-N",   "PAL-D",    "PAL-G",       "PAL-H",
+            "PAL-I",        "PAL-K",    "PAL-K1",      "PAL-L",
+            "PAL-M",        "PAL-N",    "PAL-SECAM-D", "PAL-SECAM-K",
+            "PAL-SECAM-K1", "PAL-SECAM-L"
+        ]
+
+    outInfo = re.compile(r".*: Connected Display\d+: (.+) \[(.+)\].*")
+    modeCount = re.compile(r".*: Total of \d+ modes found for .* display.*")
+    modeLine = re.compile(r".*: Modeline \"(.*)\" *.*")
+
+    primary = ""
+    secondary = ""
+    outs = []
+    parsingModesFor = ""
+
+    for line in lines:
+        if "Connected Display" in line:
+            matched = outInfo.match(line)
+            if matched:
+                info = matched.groups()
+                outs.append(info)
+                device.outputs[info[1]] = []
+
+        if "Primary Controller - " in line:
+            for out in outs:
+                if out[0] in line:
+                    primary = out[1]
+
+        if "Secondary Controller - " in line:
+            for out in outs:
+                if out[0] in line:
+                    secondary = out[1]
+
+        elif "modes found for primary display" in line:
+            matched = modeCount.match(line)
+            if matched:
+                parsingModesFor = primary
+
+        elif "modes found for secondary display" in line:
+            matched = modeCount.match(line)
+            if matched:
+                parsingModesFor = secondary
+
+        elif parsingModesFor:
+            if "Display dimensions" in line \
+                    or "DPI" in line:
+                parsingModesFor = ""
+                continue
+
+            matched = modeLine.match(line)
+            if matched:
+                mode = matched.groups()[0]
+                if not mode in device.outputs[parsingModesFor]:
+                    device.outputs[parsingModesFor].append(mode)
 
 def xserverProbe(card):
     p = XorgParser()


Uludag-commits mesaj listesiyle ilgili daha fazla bilgi