aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rwxr-xr-xmonitor-edid17
2 files changed, 9 insertions, 9 deletions
diff --git a/NEWS b/NEWS
index b8397f7..0288879 100644
--- a/NEWS
+++ b/NEWS
@@ -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;
}