aboutsummaryrefslogtreecommitdiffstats
path: root/monitor-edid
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-01-10 08:07:43 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-01-10 08:07:43 +0000
commit09746a04dcf4fb1de2dab86f352dc13f24a42976 (patch)
treefdf4ce38d70656cb33d0ea729d07a04033df3db7 /monitor-edid
parent4286c864da7c3765376d3fb22b5d02e1baec1b67 (diff)
downloadmonitor-edid-09746a04dcf4fb1de2dab86f352dc13f24a42976.tar
monitor-edid-09746a04dcf4fb1de2dab86f352dc13f24a42976.tar.gz
monitor-edid-09746a04dcf4fb1de2dab86f352dc13f24a42976.tar.bz2
monitor-edid-09746a04dcf4fb1de2dab86f352dc13f24a42976.tar.xz
monitor-edid-09746a04dcf4fb1de2dab86f352dc13f24a42976.zip
- 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)
Diffstat (limited to 'monitor-edid')
-rwxr-xr-xmonitor-edid26
1 files changed, 17 insertions, 9 deletions
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;
+ }
}
}
}