diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-02-28 23:16:36 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-02-28 23:16:36 +0000 |
commit | 9710fa2bf357cb6de2fd8069e4bca96563c822ff (patch) | |
tree | 356773964b980cbce3bad17b147175a26f8e5f1d | |
parent | bc8978e101ee9717b04743181446b42062f5751d (diff) | |
download | monitor-edid-9710fa2bf357cb6de2fd8069e4bca96563c822ff.tar monitor-edid-9710fa2bf357cb6de2fd8069e4bca96563c822ff.tar.gz monitor-edid-9710fa2bf357cb6de2fd8069e4bca96563c822ff.tar.bz2 monitor-edid-9710fa2bf357cb6de2fd8069e4bca96563c822ff.tar.xz monitor-edid-9710fa2bf357cb6de2fd8069e4bca96563c822ff.zip |
add the ratio to the preferred line
-rwxr-xr-x | monitor-parse-edid | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/monitor-parse-edid b/monitor-parse-edid index 6391551..2a2163b 100755 --- a/monitor-parse-edid +++ b/monitor-parse-edid @@ -271,9 +271,10 @@ sub parse_edid { my $horizontal_total = $h->{horizontal_active} + $h->{horizontal_blanking}; my $vertical_total = $h->{vertical_active} + $h->{vertical_blanking}; - $h->{ModeLine_comment} = sprintf qq(# Monitor preferred modeline (%.1f Hz vsync, %.1f kHz hsync)), + $h->{ModeLine_comment} = sprintf qq(# Monitor preferred modeline (%.1f Hz vsync, %.1f kHz hsync, ratio %s)), $h->{pixel_clock} / $horizontal_total / $vertical_total * 1000 * 1000, - $h->{pixel_clock} / $horizontal_total * 1000; + $h->{pixel_clock} / $horizontal_total * 1000, + nearest_ratio($h->{horizontal_active} / $h->{vertical_active}, 0.01) || sprintf("%.2f", $h->{horizontal_active} / $h->{vertical_active}); $h->{ModeLine} = sprintf qq("%dx%d" $h->{pixel_clock} %d %d %d %d %d %d %d %d %shsync %svsync), $h->{horizontal_active}, $h->{vertical_active}, |