summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAjay Singh Parmar <aparmar@codeaurora.org>2016-12-17 00:39:15 -0800
committerAjay Singh Parmar <aparmar@codeaurora.org>2016-12-21 17:35:22 -0800
commit0261d58543b0ca2c13faaceed1bb2b4a7d156db2 (patch)
treef8fe624deb78ad3a99e52d39c6e014c6be6db937
parent03a1feb1b65e53a1a6a9fc5e683e5f12c68fec2c (diff)
msm: mdss: dp: edid: read all extension blocks
A sink can have more than one EDID blocks. The extension block count is provided in the first block. Not reading all blocks can result in DP compliance failures. Read all the extension blocks as mentioned in the first block to avoid any EDID related compliance failures. Change-Id: I9cfe6403da511e6af3b887fcf858109852e9844c Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_dp_aux.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dp_aux.c b/drivers/video/fbdev/msm/mdss_dp_aux.c
index 293c049f78bc..3c6c80e26009 100644
--- a/drivers/video/fbdev/msm/mdss_dp_aux.c
+++ b/drivers/video/fbdev/msm/mdss_dp_aux.c
@@ -734,8 +734,10 @@ int mdss_dp_edid_read(struct mdss_dp_drv_pdata *dp)
int rlen, ret = 0;
int edid_blk = 0, blk_num = 0, retries = 10;
bool edid_parsing_done = false;
- const u8 cea_tag = 0x02;
+ const u8 cea_tag = 0x02, start_ext_blk = 0x1;
+ u32 const segment_addr = 0x30;
u32 checksum = 0;
+ char segment = 0x1;
ret = dp_aux_chan_ready(dp);
if (ret) {
@@ -764,7 +766,7 @@ int mdss_dp_edid_read(struct mdss_dp_drv_pdata *dp)
ret = dp_edid_buf_error(rp->data, rp->len);
if (ret) {
pr_err("corrupt edid block detected\n");
- goto end;
+ continue;
}
if (edid_parsing_done) {
@@ -782,7 +784,6 @@ int mdss_dp_edid_read(struct mdss_dp_drv_pdata *dp)
rp->data);
edid_parsing_done = true;
- checksum = rp->data[rp->len - 1];
} else {
edid_blk++;
blk_num++;
@@ -800,11 +801,17 @@ int mdss_dp_edid_read(struct mdss_dp_drv_pdata *dp)
memcpy(dp->edid_buf + (edid_blk * EDID_BLOCK_SIZE),
rp->data, EDID_BLOCK_SIZE);
+ checksum = rp->data[rp->len - 1];
+
+ /* break if no more extension blocks present */
if (edid_blk == dp->edid.ext_block_cnt)
- goto end;
+ break;
+
+ /* write segment number to read block 3 onwards */
+ if (edid_blk == start_ext_blk)
+ dp_aux_write_buf(dp, segment_addr, &segment, 1, 1);
} while (retries--);
-end:
if (dp->test_data.test_requested == TEST_EDID_READ) {
pr_debug("sending checksum %d\n", checksum);
dp_aux_send_checksum(dp, checksum);