summaryrefslogtreecommitdiffstats
path: root/perl-install/Xconfig
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-01-23 13:10:51 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-01-23 13:10:51 +0000
commitc70e56839df5a0942c00cb29707db1a2e021cf00 (patch)
tree1b8e1201b8b89b696175589f8f052de4240afd62 /perl-install/Xconfig
parent8524fabd5308049f362cd42002b472f066c4e0f8 (diff)
downloaddrakx-c70e56839df5a0942c00cb29707db1a2e021cf00.tar
drakx-c70e56839df5a0942c00cb29707db1a2e021cf00.tar.gz
drakx-c70e56839df5a0942c00cb29707db1a2e021cf00.tar.bz2
drakx-c70e56839df5a0942c00cb29707db1a2e021cf00.tar.xz
drakx-c70e56839df5a0942c00cb29707db1a2e021cf00.zip
introduce ->is_fbdev, and use it to simplify ->set_resolution
Diffstat (limited to 'perl-install/Xconfig')
-rw-r--r--perl-install/Xconfig/xfree3.pm18
-rw-r--r--perl-install/Xconfig/xfree4.pm14
-rw-r--r--perl-install/Xconfig/xfreeX.pm2
3 files changed, 18 insertions, 16 deletions
diff --git a/perl-install/Xconfig/xfree3.pm b/perl-install/Xconfig/xfree3.pm
index afb890d91..139b07d97 100644
--- a/perl-install/Xconfig/xfree3.pm
+++ b/perl-install/Xconfig/xfree3.pm
@@ -84,16 +84,6 @@ sub set_wacoms {
}
sub depths { 8, 15, 16, 24, 32 }
-sub set_resolution {
- my ($raw_X, $resolution, $Screen) = @_;
-
- $resolution = +{ %$resolution };
- if (my $Screen_ = $Screen || $raw_X->get_default_screen) {
- #- use framebuffer if Screen is
- $resolution->{fbdev} = 1 if val($Screen_->{Driver}) eq 'fbdev';
- }
- $raw_X->SUPER::set_resolution($resolution, $Screen);
-}
sub get_device_section_fields {
qw(VendorName BoardName Chipset VideoRam); #-);
@@ -111,6 +101,14 @@ sub new_device_sections {
@l;
}
+sub is_fbdev {
+ my ($raw_X, $Screen) = @_;
+
+ my $Screen_ = $Screen || $raw_X->get_default_screen or return;
+
+ val($Screen_->{Driver}) eq 'fbdev';
+}
+
sub set_Option {}
diff --git a/perl-install/Xconfig/xfree4.pm b/perl-install/Xconfig/xfree4.pm
index 7dd57dab1..a6b1e424d 100644
--- a/perl-install/Xconfig/xfree4.pm
+++ b/perl-install/Xconfig/xfree4.pm
@@ -87,11 +87,6 @@ sub set_resolution {
my ($raw_X, $resolution, $Screen) = @_;
$resolution = +{ %$resolution };
- if (my $Screen_ = $Screen || $raw_X->get_default_screen) {
- #- use framebuffer if corresponding Device has Driver framebuffer
- my $Device = $raw_X->get_Section_by_Identifier('Device', val($Screen_->{Device})) or internal_error("no device named $Screen_->{Device}");
- $resolution->{fbdev} = 1 if val($Device->{Driver}) eq 'fbdev';
- }
#- XFree4 doesn't like depth 32, silently replacing it with 24
$resolution->{Depth} = 24 if $resolution->{Depth} eq '32';
@@ -122,6 +117,15 @@ sub new_screen_sections {
@l;
}
+sub is_fbdev {
+ my ($raw_X, $Screen) = @_;
+
+ my $Screen_ = $Screen || $raw_X->get_default_screen or return;
+
+ my $Device = $raw_X->get_Section_by_Identifier('Device', val($Screen_->{Device})) or internal_error("no device named $Screen_->{Device}");
+ val($Device->{Driver}) eq 'fbdev';
+}
+
sub set_Option {
my ($_raw_X, $category, $node, @names) = @_;
diff --git a/perl-install/Xconfig/xfreeX.pm b/perl-install/Xconfig/xfreeX.pm
index 8351c5685..5ffe2c0b3 100644
--- a/perl-install/Xconfig/xfreeX.pm
+++ b/perl-install/Xconfig/xfreeX.pm
@@ -185,7 +185,7 @@ sub set_resolution {
$Screen->{DefaultColorDepth} = { val => $resolution->{Depth} };
$Screen->{Display} = [ map {
my $modes = do {
- if ($resolution->{fbdev}) {
+ if ($raw_X->is_fbdev($Screen)) {
'"default"';
} else {
my @Modes = grep {