diff options
author | huang lin <hl@rock-chips.com> | 2015-01-14 13:56:40 +0800 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-04-15 16:48:24 +0200 |
commit | c16ba0aeaa475fd6c3459cc52d4434cda2f0c45a (patch) | |
tree | a953499ad8e58562493bc6809a0a4f6ad4a94d0a /src/soc/rockchip | |
parent | 3c4951e05f2d3e0265ad892a3a229c1b508c29a8 (diff) |
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: I5951b670f129cf4765a5199cb58ac6abff5478a6
Signed-off-by: Stefan Reinauer <reinauer@chromium.org>
Original-Commit-Id: 4d508647efc0a9d48b2a4b23c12a54b63af2813e
Original-Change-Id: I8cd8e09025520322461fe940b01e4af3995b5ecd
Original-Signed-off-by: huang lin <hl@rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/240643
Original-Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-on: http://review.coreboot.org/9645
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
Diffstat (limited to 'src/soc/rockchip')
-rw-r--r-- | src/soc/rockchip/rk3288/edp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/soc/rockchip/rk3288/edp.c b/src/soc/rockchip/rk3288/edp.c index ce25c1b1fb..7b69ce8d2d 100644 --- a/src/soc/rockchip/rk3288/edp.c +++ b/src/soc/rockchip/rk3288/edp.c @@ -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; |