summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/Xconfig/xfree.pm72
1 files changed, 56 insertions, 16 deletions
diff --git a/perl-install/Xconfig/xfree.pm b/perl-install/Xconfig/xfree.pm
index 365343ee2..a21f3cff5 100644
--- a/perl-install/Xconfig/xfree.pm
+++ b/perl-install/Xconfig/xfree.pm
@@ -142,6 +142,7 @@ sub set_resolution {
{ l => { Depth => { val => $_ }, Virtual => { val => join(' ', @$resolution{'X', 'Y'}) } } };
} 8, 15, 16, 24 ];
}
+ add_gtf_ModeLines($raw_X, $resolution);
}
@@ -258,11 +259,15 @@ sub set_synaptics {
################################################################################
# monitor ######################################################################
################################################################################
-my @monitor_fields = qw(VendorName ModelName HorizSync VertRefresh ModeLine);
+my @monitor_fields = qw(VendorName ModelName HorizSync VertRefresh);
sub get_monitors {
my ($raw_X) = @_;
my @raw_monitors = $raw_X->get_Sections('Monitor');
- map { raw_export_section($_, [ 'Identifier', @monitor_fields ]) } @raw_monitors;
+ map {
+ my $h = raw_export_section($_, [ 'Identifier', @monitor_fields ]);
+ $h->{ModeLine} = $_->{ModeLine};
+ $h;
+ } @raw_monitors;
}
sub set_monitors {
my ($raw_X, @monitors) = @_;
@@ -270,6 +275,7 @@ sub set_monitors {
mapn {
my ($raw_monitor, $monitor) = @_;
raw_import_section($raw_monitor, $monitor, \@monitor_fields);
+ $raw_monitor->{ModeLine} = $monitor->{ModeLine};
} \@raw_monitors, \@monitors;
}
sub get_or_new_monitors {
@@ -292,6 +298,31 @@ sub default_ModeLine() {
ModeLine_from_string(qq(Section "Monitor"\n) . (our $default_ModeLine) . qq(EndSection\n));
}
+sub add_gtf_ModeLines {
+ my ($raw_X, $resolution) = @_;
+
+ my $banner = 'modeline generated by gtf(1) [handled by XFdrake]';
+ my $res = $resolution->{X} . 'x' . $resolution->{Y};
+ my @freqs = difference2(\@Xconfig::xfree::vfreqs, [ split(' ', $Xconfig::xfree::builtin_ModeLines{$res}) ]);
+ my @to_add = map {
+ my $s = run_program::rooted_get_stdout($::prefix, 'gtf', $resolution->{X}, $resolution->{Y}, $_);
+ my ($name, $val) = $s =~ /ModeLine\s*"(.*)"(.*)/i;
+ chomp $val;
+ $name =~ s/\.00//; #- nicer that way
+ { val => qq("${name}"$val), pre_comment => "# $banner\n" };
+ } @freqs;
+
+ $raw_X->set_monitors(map {
+ @{$_->{ModeLine}} = (
+ (grep { index($_->{pre_comment}, $banner) == -1 } @{$_->{ModeLine}}),
+ @to_add,
+ );
+ $_;
+ } $raw_X->get_monitors);
+
+ 1;
+}
+
################################################################################
# screens ######################################################################
@@ -490,7 +521,7 @@ sub ModeLine_from_string {
our @CVT_ratios = qw(5/4 4/3 3/2 16/10 15/9 16/9);
our @CVT_vfreqs = qw(50 60 75 85); # and also 60Hz "reduced blanking" in CVT
-our @more_vfreq = qw(100 120);
+our @vfreqs = (@CVT_vfreqs, qw(100 120));
our %ratio2resolutions = (
@@ -547,7 +578,9 @@ our %ratio2resolutions = (
],
);
-our @resolutions;
+our %resolution2ratio = map_each { map { $_ => $::a } @$::b } %ratio2resolutions;
+our @resolutions = map_each { @$::b } %ratio2resolutions;
+
foreach my $ratio (keys %ratio2resolutions) {
if ($ratio =~ m!^(\d+)/(\d+)$!) {
my $eval = $2 / $1;
@@ -557,9 +590,27 @@ foreach my $ratio (keys %ratio2resolutions) {
$y == $y2 or die "bad resolution $_ for ratio $ratio, it should be $x x $y2\n";
}
}
- push @resolutions, @{$ratio2resolutions{$ratio}};
}
+our %builtin_ModeLines = (
+#- '640x350' => '85', # vesa
+#- '640x400' => '85', # vesa
+#- '720x400' => '85', # vesa
+ '640x480' => '60 72 75 85', # vesa
+ '800x600' => '56 60 72 75 85', # vesa
+ '832x624' => '75',
+ '1024x768' => '43 60 70 75 85', # vesa
+ '1152x864' => '75', # vesa
+ '1280x960' => '60 85', # vesa
+ '1280x1024' => '60 75 85', # vesa
+ '1400x1050' => '60 75',
+ '1600x1024' => '60',
+ '1600x1200' => '60 65 70 75 85', # vesa
+ '1792x1344' => '60 75', # vesa
+ '1856x1392' => '60 75', # vesa
+ '1920x1440' => '60 75' . ' 85', # vesa + extra
+ '2048x1536' => '60 75 85',
+);
our $default_header = <<'END';
# File generated by XFdrake.
@@ -616,17 +667,6 @@ our $default_ModeLine = arch() =~ /ppc/ ? <<'END_PPC' : <<'END';
# Another variation
ModeLine "1280x1024" 134.989 1280 1317 1429 1688 1024 1025 1028 1066 +hsync +vsync
END_PPC
- # Sony Vaio C1(X,XS,VE,VN)?
- # 1024x480 @ 85.6 Hz, 48 kHz hsync
- ModeLine "1024x480" 65.00 1024 1032 1176 1344 480 488 494 563 -hsync -vsync
-
- # Dell D800 and few Inspiron (16/10) 1280x800
- ModeLine "1280x800" 147.89 1280 1376 1512 1744 800 801 804 848
- # Dell D800 and few Inspiron (16/10) 1680x1050
- ModeLine "1680x1050" 214.51 1680 1800 1984 2288 1050 1051 1054 1103
- # Dell D800 and few Inspiron (16/10) 1920x1200
- ModeLine "1920x1200" 230 1920 1936 2096 2528 1200 1201 1204 1250 +HSync +VSync
-
# TV fullscreen mode or DVD fullscreen output.
# 768x576 @ 79 Hz, 50 kHz hsync
ModeLine "768x576" 50.00 768 832 846 1000 576 590 595 630