rk3288: send correct edid buffer size

decode_edid() parses the whole edid buffer, regardless of whether there
is an extension buffer, so we pass the size of the EDID actually read to
prevent edid parser getting the wrong data.

BUG=chrome-os-partner:35053
TEST=Boot from jerry
BRANCH=veyron

Change-Id: I8cd8e09025520322461fe940b01e4af3995b5ecd
Signed-off-by: huang lin <hl@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/240643
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/242159
Tested-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Julius Werner <jwerner@chromium.org>
This commit is contained in:
huang lin 2015-01-14 13:56:40 +08:00 committed by ChromeOS Commit Bot
commit fba18bc797

View file

@ -765,6 +765,7 @@ static int rk_edp_read_bytes_from_i2c(struct rk_edp *edp,
static int rk_edp_read_edid(struct rk_edp *edp, struct edid *edid)
{
u8 buf[EDID_LENGTH * 2];
u32 edid_size = EDID_LENGTH;
int retval;
/* Read EDID data */
@ -778,6 +779,7 @@ static int rk_edp_read_edid(struct rk_edp *edp, struct edid *edid)
/* check if edid have extension flag, and read additional EDID data */
if (buf[EDID_EXTENSION_FLAG]) {
edid_size += EDID_LENGTH;
retval = rk_edp_read_bytes_from_i2c(edp, EDID_ADDR,
EDID_LENGTH, EDID_LENGTH,
&buf[EDID_LENGTH]);
@ -787,7 +789,7 @@ static int rk_edp_read_edid(struct rk_edp *edp, struct edid *edid)
}
}
if (decode_edid(buf, sizeof(buf), edid)) {
if (decode_edid(buf, edid_size, edid)) {
printk(BIOS_ERR, "%s: Failed to decode EDID.\n",
__func__);
return -1;