From 09746a04dcf4fb1de2dab86f352dc13f24a42976 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 10 Jan 2008 08:07:43 +0000 Subject: - 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) --- NEWS | 4 ++++ monitor-edid | 26 +++++++++++++++++--------- 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 ] [--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 ] [--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 ] [--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; + } } } } -- cgit v1.2.1