From 58a2251adfc2a7c187ed483678c6a024ac64c0af Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 13 May 2004 10:17:16 +0000 Subject: simplify Xconfig::resolution_and_depth::allowed(): adapt it to the way it's really used --- perl-install/Xconfig/resolution_and_depth.pm | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'perl-install') diff --git a/perl-install/Xconfig/resolution_and_depth.pm b/perl-install/Xconfig/resolution_and_depth.pm index 3179aab19..e01ac7ea7 100644 --- a/perl-install/Xconfig/resolution_and_depth.pm +++ b/perl-install/Xconfig/resolution_and_depth.pm @@ -81,24 +81,25 @@ sub to_string { sub allowed { my ($card) = @_; - my ($prefered_depth, @depths, @resolutions, @resolution_and_depth); + my ($prefered_depth, @resolution_and_depth); if ($card->{Driver} eq 'fbdev') { - push @resolution_and_depth, grep { $_->{Depth} == 16 } @bios_vga_modes; - } elsif ($card->{Driver} eq 'vmware') { - push @depths, 16, 8; - } elsif ($card->{Driver} eq 'fglrx') { - push @depths, 24; + @resolution_and_depth = grep { $_->{Depth} == 16 } @bios_vga_modes; } else { - if ($card->{use_DRI_GLX}) { + my @depths; + if ($card->{Driver} eq 'vmware') { + @depths = (16, 8); + } elsif ($card->{Driver} eq 'fglrx') { + @depths = 24; + } elsif ($card->{BoardName} eq 'RIVA128') { + @depths = qw(8 15 24); + } elsif ($card->{use_DRI_GLX}) { $prefered_depth = 16; - push @depths, 16, 24; + @depths = (16, 24); + } else { + @depths = our @depths_available; } - if ($card->{BoardName} eq 'RIVA128') { @depths = qw(8 15 24) } #- X doesn't even start in 16bpp for RIVA128 - } - if (!@resolution_and_depth || @depths || @resolutions) { - @depths = our @depths_available if !@depths; - @resolutions = @Xconfig::xfree::resolutions if !@resolutions; + my @resolutions = @Xconfig::xfree::resolutions; push @resolution_and_depth, map { -- cgit v1.2.1