summaryrefslogtreecommitdiffstats
path: root/perl-install/Xconfig/xfree.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/Xconfig/xfree.pm')
-rw-r--r--perl-install/Xconfig/xfree.pm103
1 files changed, 87 insertions, 16 deletions
diff --git a/perl-install/Xconfig/xfree.pm b/perl-install/Xconfig/xfree.pm
index d66c6634d..365343ee2 100644
--- a/perl-install/Xconfig/xfree.pm
+++ b/perl-install/Xconfig/xfree.pm
@@ -258,7 +258,7 @@ sub set_synaptics {
################################################################################
# monitor ######################################################################
################################################################################
-my @monitor_fields = qw(VendorName ModelName HorizSync VertRefresh);
+my @monitor_fields = qw(VendorName ModelName HorizSync VertRefresh ModeLine);
sub get_monitors {
my ($raw_X) = @_;
my @raw_monitors = $raw_X->get_Sections('Monitor');
@@ -285,9 +285,11 @@ sub get_or_new_monitors {
}
sub _new_monitor_sections {
my ($raw_X, $nb_new) = @_;
- my $ModeLine = ModeLine_from_string(qq(Section "Monitor"\n) . (our $default_ModeLine) . qq(EndSection\n));
$raw_X->remove_Section('Monitor');
- map { $raw_X->add_Section('Monitor', { Identifier => { val => "monitor$_" }, ModeLine => $ModeLine }) } (1 .. $nb_new);
+ map { $raw_X->add_Section('Monitor', { Identifier => { val => "monitor$_" }, ModeLine => default_ModeLine() }) } (1 .. $nb_new);
+}
+sub default_ModeLine() {
+ ModeLine_from_string(qq(Section "Monitor"\n) . (our $default_ModeLine) . qq(EndSection\n));
}
@@ -475,21 +477,90 @@ sub ModeLine_from_string {
-our @resolutions = (
- '640x480',
- '800x600',
- '1024x480', '1024x768',
- '1152x768', '1152x864',
- '1280x800', # 16/10,
- '1280x960', '1280x1024',
- '1400x1050',
- '1600x1200',
- '1680x1050', # 16/10
- '1920x1200', # 16/10
- '1920x1440',
- '2048x1536',
+# http://home.comcast.net/~igpl/Aspect.html
+# movies http://www.technosound.co.uk/nav.php?pageid=hcg_widescreen
+
+# www.dell.com/downloads/global/vectors/2003_cvt.pdf
+# file vesamodes in Xorg is DMT Standard Display Modes
+
+# http://www.vesa.org/Public
+# http://www.vesa.org/Public/EEDIDguideV1.pdf
+
+#- http://www.vesa.org/Public/CVT
+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 %ratio2resolutions = (
+
+ # first all the CVT_ratios
+
+ # 1.25
+ '5/4' => [ qw(640x512 720x576 1280x1024 1800x1440) ],
+
+ # 1.33
+ '4/3' => [
+ qw(320x240 480x360 640x480 800x600 832x624
+ 1024x768 1152x864 1280x960 1400x1050
+ 1600x1200 1920x1440 2048x1536),
+ ],
+
+ # 1.5
+ '3/2' => [ qw(360x240 720x480 1152x768) ],
+
+ # 1.6
+ '16/10' => [ qw(1280x800 1440x900 1600x1000 1680x1050 1920x1200) ],
+
+ # 1.67
+ '15/9' => [ qw(1280x768) ],
+
+ # 1.78
+ '16/9' => [ qw(1280x720 1600x900 1920x1080) ],
+
+
+ # now more weird things
+
+ # 1.32
+ # '192/145' => [ qw(1152x870) ],
+
+ # 1.42
+ # '17/12' => [ qw(544x384) ] ,
+
+ # 1.56
+ # '25/16' => [ qw(1600x1024) ],
+
+ # 1.775
+ # '71/15' => [ qw(852x480) ],
+
+ N_("_:weird aspect ratio\nother") => [
+ # 2.13 = 32/15
+ qw(1024x480), # VAIO
+
+ # 2.67 = 8/3
+ qw(2048x768 2560x960 3200x1200),
+
+ # 4.0 = 4/1
+ qw(3072x768 3456x864 3840x960 4800x1200),
+
+ # ?? 352x288
+ ],
);
+our @resolutions;
+foreach my $ratio (keys %ratio2resolutions) {
+ if ($ratio =~ m!^(\d+)/(\d+)$!) {
+ my $eval = $2 / $1;
+ foreach (@{$ratio2resolutions{$ratio}}) {
+ my ($x, $y) = /(\d+)x(\d+)/;
+ my $y2 = round($x * $eval);
+ $y == $y2 or die "bad resolution $_ for ratio $ratio, it should be $x x $y2\n";
+ }
+ }
+ push @resolutions, @{$ratio2resolutions{$ratio}};
+}
+
+
our $default_header = <<'END';
# File generated by XFdrake.