diff options
author | Mystery Man <unknown@mandriva.org> | 2005-10-20 14:05:54 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2005-10-20 14:05:54 +0000 |
commit | 9b6a0d83d135fad376b4eadcb2bd7bd8c8a07aa5 (patch) | |
tree | f3ef7ada2ce82dafb6d41cc087b0cc7fdfc40a46 /perl-install/Xconfig/resolution_and_depth.pm | |
parent | 3e4ad5e1b687f262a1d7cc39a0b905a595ac7f95 (diff) | |
download | drakx-9b6a0d83d135fad376b4eadcb2bd7bd8c8a07aa5.tar drakx-9b6a0d83d135fad376b4eadcb2bd7bd8c8a07aa5.tar.gz drakx-9b6a0d83d135fad376b4eadcb2bd7bd8c8a07aa5.tar.bz2 drakx-9b6a0d83d135fad376b4eadcb2bd7bd8c8a07aa5.tar.xz drakx-9b6a0d83d135fad376b4eadcb2bd7bd8c8a07aa5.zip |
This commit was manufactured by cvs2svn to create tagV10_34_11_100mdk
'V10_34_11_100mdk'.
Diffstat (limited to 'perl-install/Xconfig/resolution_and_depth.pm')
-rw-r--r-- | perl-install/Xconfig/resolution_and_depth.pm | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/perl-install/Xconfig/resolution_and_depth.pm b/perl-install/Xconfig/resolution_and_depth.pm index 436228d04..95c892f17 100644 --- a/perl-install/Xconfig/resolution_and_depth.pm +++ b/perl-install/Xconfig/resolution_and_depth.pm @@ -13,6 +13,7 @@ our %depth2text = ( 15 => N_("32 thousand colors (15 bits)"), 16 => N_("65 thousand colors (16 bits)"), 24 => N_("16 million colors (24 bits)"), + 32 => N_("4 billion colors (32 bits)"), ); our @depths_available = ikeys(%depth2text); @@ -83,21 +84,33 @@ sub allowed { my ($prefered_depth, @depths, @resolutions, @resolution_and_depth); - if ($card->{Driver} eq 'fbdev') { + my $using_xf4 = Xconfig::card::using_xf4($card); + + if ($using_xf4 ? $card->{Driver} eq 'fbdev' : $card->{server} eq 'FBDev') { push @resolution_and_depth, grep { $_->{Depth} == 16 } @bios_vga_modes; - } elsif ($card->{Driver} eq 'fglrx') { + } elsif ($using_xf4 && $card->{Driver} eq 'fglrx') { $prefered_depth = 24; push @depths, 24; - } else { + } elsif ($using_xf4) { if ($card->{use_DRI_GLX}) { $prefered_depth = 16; push @depths, 16, 24; } if ($card->{BoardName} eq 'RIVA128') { @depths = qw(8 15 24) } #- X doesn't even start in 16bpp for RIVA128 + } elsif ($card->{use_UTAH_GLX}) { + $prefered_depth = 16; + push @depths, 16; + } else { + if ($card->{server} eq 'Sun24') { push @depths, 24, 8, 2 } + elsif ($card->{server} eq 'Sun') { push @depths, 8, 2 } + elsif ($card->{server} eq 'SunMono') { push @depths, 2 } + elsif ($card->{server} eq 'VGA16') { push @depths, 8; push @resolutions, '640x480' } + elsif ($card->{BoardName} =~ /SiS/) { push @depths, 24, 16, 8 } + elsif ($card->{BoardName} eq 'S3 Trio3D') { push @depths, 24, 16, 8 } } if (!@resolution_and_depth || @depths || @resolutions) { - @depths = our @depths_available if !@depths; - @resolutions = @Xconfig::xfree::resolutions if !@resolutions; + @depths = grep { !($using_xf4 && /32/) } (our @depths_available) if !@depths; + @resolutions = @Xconfig::xfreeX::resolutions if !@resolutions; push @resolution_and_depth, map { @@ -136,16 +149,16 @@ sub choose { sub choices { - my ($_raw_X, $resolution_wanted, $card, $monitors) = @_; + my ($_raw_X, $resolution_wanted, $card, $monitor) = @_; $resolution_wanted ||= {}; my ($prefered_depth, @resolutions) = allowed($card); - @resolutions = filter_using_HorizSync($monitors->[0]{HorizSync}, @resolutions) if $monitors->[0]{HorizSync}; + @resolutions = filter_using_HorizSync($monitor->{HorizSync}, @resolutions) if $monitor->{HorizSync}; @resolutions = filter_using_VideoRam($card->{VideoRam}, @resolutions) if $card->{VideoRam}; my $x_res = do { - my $res = $resolution_wanted->{X} || ($monitors->[0]{ModelName} =~ /^Flat Panel (\d+x\d+)$/ ? $1 : size2default_resolution($monitors->[0]{size} || 14)); + my $res = $resolution_wanted->{X} || ($monitor->{ModelName} =~ /^Flat Panel (\d+x\d+)$/ ? $1 : size2default_resolution($monitor->{size} || 14)); my $x_res = first(split 'x', $res); #- take the first available resolution <= the wanted resolution max map { if_($_->{X} <= $x_res, $_->{X}) } @resolutions; @@ -167,13 +180,13 @@ sub choices { } sub configure { - my ($in, $raw_X, $card, $monitors, $b_auto) = @_; + my ($in, $raw_X, $card, $monitor, $b_auto) = @_; - my ($default_resolution, @resolutions) = choices($raw_X, $raw_X->get_resolution, $card, $monitors); + my ($default_resolution, @resolutions) = choices($raw_X, $raw_X->get_resolution, $card, $monitor); if ($b_auto) { #- use $default_resolution - if ($card->{Driver} eq 'fglrx') { + if (Xconfig::card::using_xf4($card) && $card->{Driver} eq 'fglrx') { $default_resolution = first(find { $default_resolution->{Y} eq $_->{Y} && $_->{Depth} == 24 } $default_resolution, @resolutions); $default_resolution ||= first(find { $_->{Depth} == 24 } $default_resolution, @resolutions); @@ -189,11 +202,11 @@ sub configure { } sub configure_auto_install { - my ($raw_X, $card, $monitors, $old_X) = @_; + my ($raw_X, $card, $monitor, $old_X) = @_; my $resolution_wanted = { X => $old_X->{resolution_wanted}, Depth => $old_X->{default_depth} }; - my ($default_resolution) = choices($raw_X, $resolution_wanted, $card, $monitors); + my ($default_resolution) = choices($raw_X, $resolution_wanted, $card, $monitor); $default_resolution or die "you selected an unusable depth"; $raw_X->set_resolution($default_resolution); |