Fix EDID parse error and improve test cases

The EDID parser was not using the number of native DTDs field in
the HDMI/CEA extension correctly, potentially causing use of random
values off the end of the array. This is fixed both in the show code
in edid_utils and the code in ch7036_monitor that finds the best DTD.

This fixes the bug reported by testers (exception caused by the code
walking off the end of the array) and improves one of the dogfood
feedback cases (where the code was not looking at enough DTDs).

In addition, to test the fix more test EDIDs have been added and
ch7036_monitor improved to allow them to be forced rather than what
was read from the monitor. (TODO allow them to be read from a file).

Test EDID 3 is the case that test used to cause the crash. This was
tested before and after the other code fix to check the fix worked in
that case. Test EDID 5 is from the feedback where the 1280x720p was
not being discovered by the original code.

ch7036_debug E can be used to dump all the test EDIDs.

ch7036_monitor -E<number> can be used to force test EDID <number>.

BUG=chrome-os-partner:3972
TEST=gmerge to device run debug and monitor -E tests

Change-Id: Ibcd5f0926a2363f2488b88d4b1d21a450e411a1d
Reviewed-on: http://gerrit.chromium.org/gerrit/1178
Reviewed-by: Todd Broch <tbroch@chromium.org>
Tested-by: Mark Hayter <mdhayter@chromium.org>
4 files changed