aboutsummaryrefslogtreecommitdiffstats
path: root/vbe.c
diff options
context:
space:
mode:
Diffstat (limited to 'vbe.c')
-rw-r--r--vbe.c19
1 files changed, 13 insertions, 6 deletions
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",