From f97dbb043f3d4709c32b259b180d5121fb6e399a Mon Sep 17 00:00:00 2001 From: Anssi Hannula Date: Sun, 3 Jan 2010 10:55:24 +0000 Subject: monitor-get-edid-using-vbe: never retry in console mode if the card reports that the port does not support DDC (usually this means that the port has no display devices connected) --- vbe.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'vbe.c') diff --git a/vbe.c b/vbe.c index 57c9ac9..fcd9d7f 100644 --- a/vbe.c +++ b/vbe.c @@ -203,10 +203,10 @@ static int vbe_check_ddc_capabilities(int port) if (!(regs.ebx & 3)) { log_err("DDC (0x4f15:00): DDC not supported, not continuing\n", i); - return 0; + return 1; } - return 1; + return 2; } static int vbe_get_edid_info(char *edid, int port, int block) @@ -260,6 +260,12 @@ static int vbe_get_edid_info(char *edid, int port, int block) return 1; } +/* return values: + * size of edid: success + * 0: success but no edid + * -1: failure, VBE info call worked + * -2: failure, VBE info call didn't work + */ int get_edid(char *edid, int port, int skip_vbe_check) { int i, extensions; @@ -275,12 +281,13 @@ int get_edid(char *edid, int port, int skip_vbe_check) return -1; } - ok = vbe_check_ddc_capabilities(port) && - vbe_get_edid_info(edid, port, 0); - - if (!ok) + ok = vbe_check_ddc_capabilities(port); + if (ok == 1) /* success but no DDC */ return 0; + if (!ok || !vbe_get_edid_info(edid, port, 0)) + return -2; + extensions = ((unsigned char*)edid)[126]; if (extensions > MAX_EXTENSION_COUNT) { log_err("EDID: Reported %d extensions, only reading %d\n", -- cgit v1.2.1