summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2014-04-03 18:35:58 +0800
committerIsaac Christensen <isaac.christensen@se-eng.com>2014-10-01 17:24:43 +0200
commit79445817aedacb5b1edbd6db2e3b6edab97eb5e0 (patch)
treefd0ccd9882c02943125f1aab334777338e0d535f /src/lib
parentfc0d244b39ec640ba8040b64e09e2fb5c931f95f (diff)
edid: Fix extension parsing when EDID blob does not have any extensions.
When parsing "extensions", we should skip the first EDID (main) block and start from offset 128 (EDID may have only main block, so an EDID without any extension is fine) because the header format for main block and extensions are different. Without this we will see "Unknown extension block" on all EDIDs, and seeing an error (1) return value for EDIDs without extension. Also, after the first "unknown" error is fixed, we can now collect all return values from parse_extension, and return an error when any of the extensions are wrong (not just last one). Change-Id: I0ee029ac8ec6800687cd7749e23989399e721109 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/193011 (cherry picked from commit fdf0cc2e9573c19b550fa2b5e4e06337b114f864) Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com> Reviewed-on: http://review.coreboot.org/6995 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/edid.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/edid.c b/src/lib/edid.c
index 0dc86d5153..6bd471a31c 100644
--- a/src/lib/edid.c
+++ b/src/lib/edid.c
@@ -1261,8 +1261,14 @@ int decode_edid(unsigned char *edid, int size, struct edid *out)
printk(BIOS_SPEW, "Checksum\n");
do_checksum(edid);
- for(i = 0; i < size; i += 128)
- nonconformant_extension = parse_extension(out, &edid[i]);
+
+ /* EDID v2.0 has a larger blob (256 bytes) and may have some problem in
+ * the extension parsing loop below. Since v2.0 was quickly deprecated
+ * by v1.3 and we are unlikely to use any EDID 2.0 panels, we ignore
+ * that case now and can fix it when we need to use a real 2.0 panel.
+ */
+ for(i = 128; i < size; i += 128)
+ nonconformant_extension += parse_extension(out, &edid[i]);
/*
* x = edid;
* for (edid_lines /= 8; edid_lines > 1; edid_lines--) {