aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rwxr-xr-xmonitor-edid26
2 files changed, 21 insertions, 9 deletions
diff --git a/NEWS b/NEWS
index 0afcb00..f8de1d4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+- monitor-edid, monitor-get-edid:
+ o call monitor-get-edid-using-vbe with a range of ports, it stops on first
+ success (by default it tries port 0 then port 1)
+
Version 1.13 - 8 January 2007
- monitor-get-edid:
diff --git a/monitor-edid b/monitor-edid
index 61b3e4e..07218f7 100755
--- a/monitor-edid
+++ b/monitor-edid
@@ -3,10 +3,11 @@
use Getopt::Long;
my %opt = ('acpi-dir' => "/proc/acpi/video");
-my @common_options = ('verbose', 'try-in-console', 'no-vbe', 'acpi-dir=s');
+my @common_options = ('verbose', 'try-in-console', 'no-vbe', 'acpi-dir=s', 'vbe-port=i', 'max-vbe-port=i');
+my $common_options_usage = '[-v] [--acpi-dir <dir>] [--try-in-console] [--vbe-port <0-3>] [--max-vbe-port <0-3>]';
if ($0 =~ /monitor-get-edid/) {
- GetOptions_(@common_options) or die "usage: monitor-get-edid [-v] [--acpi-dir <dir>] [--try-in-console]\n";
+ GetOptions_(@common_options) or die "usage: monitor-get-edid $common_options_usage\n";
if (my @edids = get_edids(1)) {
print $edids[0][1];
@@ -16,7 +17,7 @@ if ($0 =~ /monitor-get-edid/) {
}
} else {
GetOptions_(@common_options, 'MonitorsDB', 'perl')
- or die "usage: monitor-edid [-v] [--acpi-dir <dir>] [--perl] [--MonitorsDB] [--try-in-console]\n";
+ or die "usage: monitor-edid $common_options_usage [--perl] [--MonitorsDB]\n";
my $err = 1;
@@ -68,12 +69,19 @@ sub get_edids {
if (!@l || !$b_get_first && $< == 0) {
if (my $cmd = get_using_vbe()) {
- warn "probing EDID using VBE\n" if $opt{verbose};
- my $edid = `$cmd`;
- if (grep { $_->[1] eq $edid } @l) {
- # already found, forget it
- } else {
- push @l, [ vbe => $edid ];
+ my $min_port = $opt{'vbe-port'} || 0;
+ my $max_port = $opt{'max-vbe-port'} || $opt{'vbe-port'} || 1;
+ 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 ];
+ last;
+ }
}
}
}