From ff26001d9377b12b822b574dc19fdbc2a8114585 Mon Sep 17 00:00:00 2001 From: Anssi Hannula Date: Sun, 3 Jan 2010 07:58:16 +0000 Subject: monitor-parse-edid: add comment "Monitor preferred modeline" only for the modeline the monitor reports as preferred, and add "Monitor supported modeline" comment for the other modelines --- monitor-parse-edid | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'monitor-parse-edid') diff --git a/monitor-parse-edid b/monitor-parse-edid index 72978c3..2e823e4 100755 --- a/monitor-parse-edid +++ b/monitor-parse-edid @@ -465,6 +465,10 @@ sub parse_edid { $edid{ratio_name} = ratio_name($edid{max_size_horizontal}, $edid{max_size_vertical}, 'cm'); $edid{ratio_precision} = 'cm'; } + + if ($edid{feature_support}->{has_preferred_timing} && $edid{detailed_timings}[0]) { + $edid{detailed_timings}[0]->{preferred} = 1; + } foreach my $h (@{$edid{detailed_timings}}) { @@ -516,8 +520,9 @@ 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 %s modeline (%.1f Hz vsync, %.1f kHz hsync, %sratio %s%s)), - $h->{source} eq 'cea_vdb' ? "supported CEA" : "preferred", + $h->{ModeLine_comment} = sprintf qq(# Monitor %s%s modeline (%.1f Hz vsync, %.1f kHz hsync, %sratio %s%s)), + $h->{preferred} ? "preferred" : "supported", + $h->{source} eq 'cea_vdb' ? " CEA" : '', $h->{pixel_clock} / $horizontal_total / $vertical_total * 1000 * 1000 * ($h->{interlaced} ? 2 : 1), $h->{pixel_clock} / $horizontal_total * 1000, $h->{interlaced} ? "interlaced, " : '', -- cgit v1.2.1