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>
This commit is contained in:
parent
fc0d244b39
commit
79445817ae
|
@ -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--) {
|
||||
|
|
Loading…
Reference in New Issue