diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-09-26 10:02:03 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-09-26 10:02:03 +0000 |
commit | efd1f920489f88cb8a1e9d636f974bb4af15a2c8 (patch) | |
tree | 6cc50f847f5bceb345917126ce5439b2fb0a43c9 /lib/Xconfig | |
parent | 68317beb0285688da032f164a72d5f831e2fd33c (diff) | |
download | drakx-kbd-mouse-x11-efd1f920489f88cb8a1e9d636f974bb4af15a2c8.tar drakx-kbd-mouse-x11-efd1f920489f88cb8a1e9d636f974bb4af15a2c8.tar.gz drakx-kbd-mouse-x11-efd1f920489f88cb8a1e9d636f974bb4af15a2c8.tar.bz2 drakx-kbd-mouse-x11-efd1f920489f88cb8a1e9d636f974bb4af15a2c8.tar.xz drakx-kbd-mouse-x11-efd1f920489f88cb8a1e9d636f974bb4af15a2c8.zip |
- monitor-probe-using-X can now return EDIDs. if Xorg find an EDID (whereas
monitor-get-edid-using-vbe failed), defaults to "Plug'n Play" monitor (ie
let Xorg do things automatically) instead of good_default_monitor.
Diffstat (limited to 'lib/Xconfig')
-rw-r--r-- | lib/Xconfig/monitor.pm | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/lib/Xconfig/monitor.pm b/lib/Xconfig/monitor.pm index dcbd800..747becc 100644 --- a/lib/Xconfig/monitor.pm +++ b/lib/Xconfig/monitor.pm @@ -177,7 +177,7 @@ sub configure_automatic { sub is_valid { my ($monitor) = @_; - $monitor->{HorizSync} && $monitor->{VertRefresh}; + $monitor->{HorizSync} && $monitor->{VertRefresh} || $monitor->{VendorName} eq "Plug'n Play"; } sub probe { @@ -211,12 +211,18 @@ sub probe_DDC() { my ($edid, $vbe) = any::monitor_full_edid() or return; my $monitor = eval($edid); - adjust_HorizSync_from_edid($monitor); - adjust_VertRefresh_from_edid($monitor); - if ($vbe =~ /Memory: (\d+)k/) { $monitor->{VideoRam_probed} = $1; } + use_EDID($monitor); +} + +sub use_EDID { + my ($monitor) = @_; + + adjust_HorizSync_from_edid($monitor); + adjust_VertRefresh_from_edid($monitor); + $monitor->{ModeLine} = Xconfig::xfree::default_ModeLine(); my $detailed_timings = $monitor->{detailed_timings} || []; foreach (grep { !$_->{bad_ratio} } @$detailed_timings) { @@ -259,10 +265,16 @@ sub probe_using_X { require modules; my @old_modules = modules::loaded_modules(); - my $resolution = run_program::rooted_get_stdout($::prefix, 'monitor-probe-using-X', $card_Driver); + my $resolution = run_program::rooted_get_stdout($::prefix, 'monitor-probe-using-X', '--perl', $card_Driver); modules::unload(difference2([ modules::loaded_modules() ], \@old_modules)); - $resolution && generic_flat_panel(chomp_($resolution)); + $resolution = eval($resolution) or return; + + if (my $res = $resolution->[0]{preferred_resolution}) { + generic_flat_panel_($res->{X}, $res->{Y}); + } else { + { VendorName => "Plug'n Play" }; + } } sub probe_DMI() { @@ -273,9 +285,13 @@ sub probe_DMI() { sub generic_flat_panel { my ($resolution) = @_; my ($X, $Y) = $resolution =~ /(\d+)x(\d+)/ or log::l("bad resolution $resolution"), return; + generic_flat_panel_($X, $Y); +} +sub generic_flat_panel_ { + my ($X, $Y) = @_; { VendorName => 'Generic', - ModelName => "Flat Panel $resolution", + ModelName => "Flat Panel ${X}x${Y}", HorizSync => '31.5-' . ($X > 1920 ? '100' : '90'), VertRefresh => '60', preferred_resolution => { X => $X, Y => $Y }, }; |