diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-02-23 18:43:56 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-02-23 18:43:56 +0000 |
commit | 8c463e6886ec1c4d9b337a1922cd52df5d7f9120 (patch) | |
tree | aee0025ac2c82f52ecb4f44bd6dafc79e4475051 /monitor-parse-edid | |
parent | 18a0736f62ba19da5e7ce3b02eb654dab2984cb9 (diff) | |
download | monitor-edid-8c463e6886ec1c4d9b337a1922cd52df5d7f9120.tar monitor-edid-8c463e6886ec1c4d9b337a1922cd52df5d7f9120.tar.gz monitor-edid-8c463e6886ec1c4d9b337a1922cd52df5d7f9120.tar.bz2 monitor-edid-8c463e6886ec1c4d9b337a1922cd52df5d7f9120.tar.xz monitor-edid-8c463e6886ec1c4d9b337a1922cd52df5d7f9120.zip |
- rename field EISA to EISA_ID
- add fields HorizSync, VertRefresh in main edid
- add fields ModeLine and ModeLine_comment in detailed_timing
Diffstat (limited to 'monitor-parse-edid')
-rwxr-xr-x | monitor-parse-edid | 55 |
1 files changed, 33 insertions, 22 deletions
diff --git a/monitor-parse-edid b/monitor-parse-edid index d1933fd..bd90b5d 100755 --- a/monitor-parse-edid +++ b/monitor-parse-edid @@ -184,7 +184,36 @@ sub parse_edid { $edid{$field} = $v if $field && $field !~ /^_/; } - $edid{EISA} = $edid{manufacturer_name} . sprintf('%x', $edid{product_code}); + $edid{EISA_ID} = $edid{manufacturer_name} . sprintf('%x', $edid{product_code}); + + if ($edid{monitor_range}) { + $edid{HorizSync} = $edid{monitor_range}{horizontal_min} . '-' . $edid{monitor_range}{horizontal_max}; + $edid{VertRefresh} = $edid{monitor_range}{vertical_min} . '-' . $edid{monitor_range}{vertical_max}; + } + + foreach my $h (@{$edid{detailed_timings}}) { + + my $horizontal_total = $h->{horizontal_active} + $h->{horizontal_blanking}; + my $vertical_total = $h->{vertical_active} + $h->{vertical_blanking}; + + $h->{ModeLine_comment} = sprintf qq(# %dx%d @ %.1f Hz, %.1f kHz hsync), + $h->{horizontal_active}, $h->{vertical_active}, + $h->{pixel_clock} / $horizontal_total / $vertical_total * 1000 * 1000, + $h->{pixel_clock} / $horizontal_total * 1000; + + $h->{ModeLine} = sprintf qq(ModeLine "%dx%d" $h->{pixel_clock} %d %d %d %d %d %d %d %d), + $h->{horizontal_active}, $h->{vertical_active}, + + $h->{horizontal_active}, + $h->{horizontal_active} + $h->{horizontal_sync_offset}, + $h->{horizontal_active} + $h->{horizontal_sync_offset} + $h->{horizontal_sync_pulse_width}, + $horizontal_total, + + $h->{vertical_active}, + $h->{vertical_active} + $h->{vertical_sync_offset}, + $h->{vertical_active} + $h->{vertical_sync_offset} + $h->{vertical_sync_pulse_width}, + $vertical_total; + } \%edid; } @@ -195,7 +224,7 @@ sub print_edid { sqr($edid->{max_size_vertical})) / 2.54; print "Name: $edid->{monitor_name}\n"; - print "EISA ID: $edid->{EISA}\n"; + print "EISA ID: $edid->{EISA_ID}\n"; printf "Screen size: %d cm x %d cm (%3.2f inches)\n", $edid->{max_size_horizontal}, $edid->{max_size_vertical}, $diagonal_inches * 1.08; print "Gamma: ", $edid->{gamma} / 100 + 1, "\n"; @@ -209,27 +238,9 @@ sub print_edid { } foreach my $h (@{$edid->{detailed_timings}}) { - my $horizontal_total = $h->{horizontal_active} + $h->{horizontal_blanking}; - my $vertical_total = $h->{vertical_active} + $h->{vertical_blanking}; - print "\n"; - printf qq(\t# %dx%d @ %.1f Hz, %.1f kHz hsync\n), - $h->{horizontal_active}, $h->{vertical_active}, - $h->{pixel_clock} / $horizontal_total / $vertical_total * 1000 * 1000, - $h->{pixel_clock} / $horizontal_total * 1000; - - printf qq(\tModeLine "%dx%d" $h->{pixel_clock} %d %d %d %d %d %d %d %d\n), - $h->{horizontal_active}, $h->{vertical_active}, - - $h->{horizontal_active}, - $h->{horizontal_active} + $h->{horizontal_sync_offset}, - $h->{horizontal_active} + $h->{horizontal_sync_offset} + $h->{horizontal_sync_pulse_width}, - $h->{horizontal_total}, - - $h->{vertical_active}, - $h->{vertical_active} + $h->{vertical_sync_offset}, - $h->{vertical_active} + $h->{vertical_sync_offset} + $h->{vertical_sync_pulse_width}, - $h->{vertical_total}; + print "\t", $h->{ModeLine_comment}, "\n"; + print "\t", $h->{ModeLine}, "\n"; } } |