summaryrefslogtreecommitdiffstats
path: root/xf86config.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>1999-08-31 17:12:49 +0000
committerMatt Wilson <msw@redhat.com>1999-08-31 17:12:49 +0000
commit937b34d9a093b60f04f8c84a3014a7786ecdd035 (patch)
tree396a64787840af32c3c9661935f656318de75a3b /xf86config.py
parent50ef7a0daf032d9802e8476f92d3a148982fd7be (diff)
downloadanaconda-937b34d9a093b60f04f8c84a3014a7786ecdd035.tar.gz
anaconda-937b34d9a093b60f04f8c84a3014a7786ecdd035.tar.xz
anaconda-937b34d9a093b60f04f8c84a3014a7786ecdd035.zip
more fixes
Diffstat (limited to 'xf86config.py')
-rw-r--r--xf86config.py44
1 files changed, 39 insertions, 5 deletions
diff --git a/xf86config.py b/xf86config.py
index 013796a34..bc675ed30 100644
--- a/xf86config.py
+++ b/xf86config.py
@@ -22,7 +22,34 @@ class XF86Config:
self.monID = None
self.devID = None
self.probed = 0
-
+ self.modes = { "8" : ["640x480"],
+ "16" : ["640x480"],
+ "32" : ["640x480"], }
+
+ def filterModesByMemory (self):
+ if not self.vidRam:
+ return
+ if string.atoi(self.vidRam) >= 4096:
+ self.modes["8"] = ["640x480", "800x600", "1024x768", "1152x864", "1280x1024", "1600x1200"]
+ self.modes["16"] = ["640x480", "800x600", "1024x768", "1152x864", "1280x1024", "1600x1200"]
+ self.modes["32"] = ["640x480", "800x600", "1024x768", "1152x864"]
+ elif string.atoi(self.vidRam) >= 2048:
+ self.modes["8"] = ["640x480", "800x600", "1024x768", "1152x864", "1280x1024"]
+ self.modes["16"] = ["640x480", "800x600", "1024x768", "1152x864"]
+ self.modes["32"] = ["640x480", "800x600"]
+ elif string.atoi(self.vidRam) >= 2048:
+ self.modes["8"] = ["640x480", "800x600", "1024x768", "1152x864"]
+ self.modes["16"] = ["640x480", "800x600"]
+ self.modes["32"] = ["640x480"]
+ elif string.atoi(self.vidRam) >= 512:
+ self.modes["8"] = ["640x480", "800x600"]
+ self.modes["16"] = ["640x480"]
+ self.modes["32"] = []
+ elif string.atoi(self.vidRam) >= 256:
+ self.modes["8"] = ["640x480"]
+ self.modes["16"] = []
+ self.modes["32"] = []
+
def cards (self, thecard = None):
cards = {}
db = open ('/usr/X11R6/lib/X11/Cards')
@@ -114,7 +141,8 @@ class XF86Config:
self.monEisa = line[9:]
if line and line[:6] == "\tName:":
- self.monName = line[7:]
+ 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, ',')
@@ -621,14 +649,17 @@ EndSection
Monitor "%(MONITOR)s"
""" % info
# for depth in self.depths:
- for depth in [ '32', '24', '16', '8']:
+ for depth in self.modes.keys ():
section = section + """
Subsection "Display"
Depth %s
- Modes "640x480"
+ Modes """ % depth
+ for res in self.modes[depth]:
+ section = section + '"' + res + '" '
+ section = section + """
ViewPort 0 0
EndSubsection
-""" % (depth,)
+"""
section = section + "EndSection\n"
return section
@@ -642,4 +673,7 @@ if __name__ == "__main__":
print x.mouseSection ()
print x.monitorSection ()
print x.deviceSection ()
+ x.modes["8"] = [ "640x480" ]
+ x.modes["16"] = [ "640x480" ]
+ x.modes["32"] = [ "640x480" ]
print x.screenSection ()