diff options
author | Anssi Hannula <anssi@mandriva.org> | 2010-01-03 09:59:29 +0000 |
---|---|---|
committer | Anssi Hannula <anssi@mandriva.org> | 2010-01-03 09:59:29 +0000 |
commit | 3e367473f5b36426d753645ec945ac8c3e7be13e (patch) | |
tree | a09e3cb2bf891570872cd9c7994377cf41aadd46 | |
parent | 76fca20cd2f018d12509de2117b0edc43d495727 (diff) | |
download | monitor-edid-3e367473f5b36426d753645ec945ac8c3e7be13e.tar monitor-edid-3e367473f5b36426d753645ec945ac8c3e7be13e.tar.gz monitor-edid-3e367473f5b36426d753645ec945ac8c3e7be13e.tar.bz2 monitor-edid-3e367473f5b36426d753645ec945ac8c3e7be13e.tar.xz monitor-edid-3e367473f5b36426d753645ec945ac8c3e7be13e.zip |
monitor-edid, monitor-get-edid:
- do not get duplicate EDIDs if the same EDID is available via
multiple methods
- allow retrieval of multiple EDIDs via VBE
-rw-r--r-- | NEWS | 1 | ||||
-rwxr-xr-x | monitor-edid | 17 |
2 files changed, 9 insertions, 9 deletions
@@ -31,6 +31,7 @@ - monitor-edid, monitor-get-edid: o do not get duplicate EDIDs if the same EDID is available via multiple methods + o allow retrieval of multiple EDIDs via VBE Version 2.5 - 18 October 2009, by Anssi Hannula diff --git a/monitor-edid b/monitor-edid index d1e7d61..bca967b 100755 --- a/monitor-edid +++ b/monitor-edid @@ -78,9 +78,10 @@ sub parse_edid() { sub get_edids { my ($b_get_first) = @_; + my %seen = (); my @l = map { my $s = slurp($_); - is_edid_possibly_valid($s) ? [ $_ => $s ] : (); + (is_edid_possibly_valid($s) && !$seen{ $_[1] }++) ? [ $_ => $s ] : (); } get_edid_files(); if (!@l || !$b_get_first && $< == 0) { @@ -90,19 +91,17 @@ sub get_edids { foreach my $port ($min_port .. $max_port) { warn "probing EDID using VBE (port $port)\n" if $opt{verbose}; my $edid = `$cmd --port $port`; - is_edid_possibly_valid($edid) or next; - - if (grep { $_->[1] eq $edid } @l) { - # already found, forget it - } else { - push @l, [ vbe => $edid ]; + if ($? >> 8 == 2) { + warn "VBE info call failed, skipping all ports\n" if $opt{verbose}; last; } + is_edid_possibly_valid($edid) or next; + + next if grep { $_->[1] eq $edid } @l; + push @l, [ "vbe$port" => $edid ]; } } } - my %seen = (); - @l = grep { !$seen{ $_[1] }++ } @l; @l; } |