summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-01-04 22:38:58 +0000
committerJeremy Katz <katzj@redhat.com>2002-01-04 22:38:58 +0000
commitec3bb5b4fce530bbd774172bc8c8c61bd54994ba (patch)
tree5fbcfa784becff1f152e5df8fccae4ebf2c9ef48
parentaab9ec05cb63905c28437a7fe5fd1fd2b90ee692 (diff)
downloadanaconda-ec3bb5b4fce530bbd774172bc8c8c61bd54994ba.tar.gz
anaconda-ec3bb5b4fce530bbd774172bc8c8c61bd54994ba.tar.xz
anaconda-ec3bb5b4fce530bbd774172bc8c8c61bd54994ba.zip
use kudzu ddc probing
-rw-r--r--monitor.py31
-rw-r--r--videocard.py23
2 files changed, 24 insertions, 30 deletions
diff --git a/monitor.py b/monitor.py
index 62b19674a..6b805a6c3 100644
--- a/monitor.py
+++ b/monitor.py
@@ -177,22 +177,21 @@ class MonitorInfo:
# VESA probe for monitor/videoram, etc.
if not skipDDCProbe:
try:
- probe = string.split (iutil.execWithCapture ("/usr/sbin/ddcprobe", ['ddcprobe']), '\n')
- for line in probe:
- if line and line[:8] == "EISA ID:":
- self.monEisa = string.lower(line[9:])
- self.monID = line[9:]
-
- if line and line[:6] == "\tName:":
- if not self.monName or len (self.monName) < len (line[7:]):
- self.monName = line[7:]
-
- if line and line[:15] == "\tTiming ranges:":
- ranges = string.split (line, ',')
- self.monHoriz = string.strip (string.split (ranges[0], '=')[1])
- self.monVert = string.strip (string.split (ranges[1], '=')[1])
- self.monHoriz = string.replace(self.monHoriz, " " , "")
- self.monVert = string.replace(self.monVert, " ", "")
+ monitor = kudzu.probe(kudzu.CLASS_MONITOR, kudzu.BUS_DDC,
+ kudzu.PROBE_ALL)
+ if monitor:
+ self.monEisa = monitor[0].id
+ self.monID = monitor[0].id
+
+ # only guess the timings if something is non-zero
+ if (monitor[0].horizSyncMin != 0 or
+ monitor[0].horizSyncMax != 0 or
+ monitor[0].vertRefreshMin != 0 or
+ monitor[0].vertRefreshMax != 0):
+ self.monHoriz = "%d-%d" % (monitor[0].horizSyncMin,
+ monitor[0].horizSyncMax)
+ self.monVert = "%d-%d" % (monitor[0].vertRefreshMin,
+ monitor[0].vertRefreshMax)
if self.monEisa:
# read the monitor DB
diff --git a/videocard.py b/videocard.py
index 0ec6a2534..5bc465a7b 100644
--- a/videocard.py
+++ b/videocard.py
@@ -368,7 +368,7 @@ class VideoCardInfo:
def __init__ (self, skipDDCProbe = 0):
cards = kudzu.probe (kudzu.CLASS_VIDEO,
- kudzu.BUS_UNSPEC,
+ kudzu.BUS_PCI | kudzu.BUS_SBUS,
kudzu.PROBE_ALL);
# just use first video card we recognize
@@ -429,19 +429,14 @@ class VideoCardInfo:
# VESA probe for videoram, etc.
# for now assume fb corresponds to primary video card
if not skipDDCProbe:
- try:
- probe = string.split (iutil.execWithCapture ("/usr/sbin/ddcprobe", ['ddcprobe']), '\n')
- for line in probe:
- if line and line[:9] == "OEM Name:":
- cardManf = string.strip (line[10:])
- self.primaryCard().setCardManf(cardManf)
- self.primaryCard().getCardData()["VENDOR"] = cardManf
- if line and line[:16] == "Memory installed":
- memory = string.split (line, '=')
- self.primaryCard().setVideoRam(string.strip (memory[2][:-2]))
- except:
- log("ddcprobe failed")
- pass
+ probe = kudzu.probe(kudzu.CLASS_VIDEO, kudzu.BUS_DDC,
+ kudzu.PROBE_ALL)
+ if probe:
+ # XXX should we use this description?
+ #self.primaryCard().setDescription(probe[0].desc)
+
+ if mem != 0:
+ self.primaryCard().setVideoRam(probe[0].mem)
# try to get frame buffer information if we don't know video ram
if not self.primaryCard().getVideoRam() and self.primaryCard().getDevice():