diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-03-01 10:02:21 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-03-01 10:02:21 +0000 |
commit | 12d1995e0298da4e251219851d77f4e8cde495df (patch) | |
tree | 4dff9868d5ffb3c7b0a3faef0d6f6f283086d767 | |
parent | 29bba0af7e3ed3af74d74c8b2e527e73a5f59c66 (diff) | |
download | monitor-edid-12d1995e0298da4e251219851d77f4e8cde495df.tar monitor-edid-12d1995e0298da4e251219851d77f4e8cde495df.tar.gz monitor-edid-12d1995e0298da4e251219851d77f4e8cde495df.tar.bz2 monitor-edid-12d1995e0298da4e251219851d77f4e8cde495df.tar.xz monitor-edid-12d1995e0298da4e251219851d77f4e8cde495df.zip |
say if the detailed_timing doesn't have the same ratio
(in that case we won't use it as a ModeLine nor as the default resolution)
-rwxr-xr-x | monitor-parse-edid | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/monitor-parse-edid b/monitor-parse-edid index 8c99fde..ba26d26 100755 --- a/monitor-parse-edid +++ b/monitor-parse-edid @@ -292,6 +292,12 @@ sub parse_edid { $edid{VertRefresh} = $edid{monitor_range}{vertical_min} . '-' . $edid{monitor_range}{vertical_max}; } + if ($edid{max_size_vertical}) { + $edid{ratio} = $edid{max_size_horizontal} / $edid{max_size_vertical}; + $edid{ratio_name} = ratio_name($edid{max_size_horizontal}, $edid{max_size_vertical}, 'cm'); + $edid{ratio_precision} = 'cm'; + } + foreach my $h (@{$edid{detailed_timings}}) { my $horizontal_total = $h->{horizontal_active} + $h->{horizontal_blanking}; my $vertical_total = $h->{vertical_active} + $h->{vertical_blanking}; @@ -331,17 +337,13 @@ sub parse_edid { $edid{ratio_name} = ratio_name($in_cm{horizontal}, $in_cm{vertical}, 'mm'); $edid{ratio_precision} = 'mm'; } + + $h->{bad_ratio} = 1 if abs($edid{ratio} - $h->{horizontal_active} / $h->{vertical_active}) > ($edid{ratio_precision} eq 'mm' ? 0.02 : 0.2); } $edid{diagonal_size} = sqrt(sqr($edid{max_size_horizontal}) + sqr($edid{max_size_vertical})) / 2.54; - if (!$edid{ratio} && $edid{max_size_vertical}) { - $edid{ratio} = $edid{max_size_horizontal} / $edid{max_size_vertical}; - $edid{ratio_name} = ratio_name($edid{max_size_horizontal}, $edid{max_size_vertical}, 'cm'); - $edid{ratio_precision} = 'cm'; - } - \%edid; } @@ -410,7 +412,7 @@ sub print_edid { foreach my $h (@{$edid->{detailed_timings}}) { print "\n"; - print "\t", $h->{ModeLine_comment}, "\n"; + print "\t", $h->{ModeLine_comment}, $h->{bad_ratio} ? ' (bad ratio)' : '', "\n"; print "\tModeLine ", $h->{ModeLine}, "\n"; } } |