summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/Xconfig/monitor.pm44
1 files changed, 43 insertions, 1 deletions
diff --git a/perl-install/Xconfig/monitor.pm b/perl-install/Xconfig/monitor.pm
index 27475c0d1..eb6a7fc7e 100644
--- a/perl-install/Xconfig/monitor.pm
+++ b/perl-install/Xconfig/monitor.pm
@@ -156,8 +156,47 @@ sub configure_automatic {
return $monitor->{HorizSync} && $monitor->{VertRefresh};
}
+# Parse XFree86 log in case with got not valuable information from
+# ddcxinfos. NOTE: this is only safe at install stage.
+sub getinfoFromXFree() {
+ my $xf86log = "/var/log/XFree86.0.log";
+ $::isInstall && -r $xf86log or return;
+
+ my ($VideoRAM, $HorizSync, $VertRefresh, $VendorName, $EISA_ID, $size);
+ for (cat_($xf86log)) {
+ if (/(VideoRAM|Total Mem): (\d+) kB/) {
+ $VideoRAM = $2;
+ }
+ elsif (/hsync range of ([.\d]+-[.\d]+) kHz/) {
+ $HorizSync = $1;
+ }
+ elsif (/vrefresh range of ([.\d]+-[.\d]+) Hz/) {
+ $VertRefresh = $1;
+ }
+ elsif (/(Display dimensions|Image Size):\s+\(?(\d+)[,x\s]+(\d+)\)? mm/) {
+ my ($x, $y) = (($2+9)/10, ($3+9)/10); # round up
+ $size = sqrt($x*$x + $y*$y) / 2.54 * 1.08;
+ }
+ elsif (/Monitor name: (.+)/) {
+ $VendorName = $1;
+ }
+ elsif (/Manufacturer: (\w+)\s+Model: (\w+)/) {
+ $EISA_ID = "$1$2";
+ }
+ }
+
+ {
+ VideoRam_probed => $VideoRAM,
+ HorizSync => $HorizSync,
+ VertRefresh => $VertRefresh,
+ size => $size,
+ if_($EISA_ID, EISA_ID => lc($EISA_ID)),
+ VendorName => $VendorName || "Plug'n Play",
+ }
+}
+
sub getinfoFromDDC() {
- my ($VideoRam, @l) = any::ddcxinfos() or return;
+ my ($VideoRam, @l) = any::ddcxinfos() or return getinfoFromXFree();
my @Modes;
local $_;
@@ -168,6 +207,9 @@ sub getinfoFromDDC() {
push @Modes, [ $x, $y, $depth ];
}
+ # last chance to get some useful information
+ return getinfoFromXFree() if ! @l;
+
my ($h, $v, $size, @_modes) = @l;
{
VideoRam_probed => to_int($VideoRam),