From 854c3e5023035951184375b7bb83525878b9a7fb Mon Sep 17 00:00:00 2001 From: Anssi Hannula Date: Sun, 3 Jan 2010 08:50:08 +0000 Subject: monitor-get-edid-using-vbe: - add --skip-vbe-check for skipping call for VBE info; useful if calling the program multiple times for different ports - on failure, return exit status 2 if no successful VBE calls were made --- vbe.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'vbe.c') diff --git a/vbe.c b/vbe.c index 56882d3..57c9ac9 100644 --- a/vbe.c +++ b/vbe.c @@ -260,20 +260,23 @@ static int vbe_get_edid_info(char *edid, int port, int block) return 1; } -int get_edid(char *edid, int port) +int get_edid(char *edid, int port, int skip_vbe_check) { int i, extensions; int ok = 0; if (getuid() != 0) { fprintf(stderr, "you must be root to run this program\n"); - return 0; + return -1; } - ok = - (box_is_xbox() || (vbe_check_vbe_info() && - vbe_check_ddc_capabilities(port))) && - vbe_get_edid_info(edid, port, 0); + if (!box_is_xbox() && !skip_vbe_check) { + if (!vbe_check_vbe_info()) + return -1; + } + + ok = vbe_check_ddc_capabilities(port) && + vbe_get_edid_info(edid, port, 0); if (!ok) return 0; -- cgit v1.2.1