msm: mdss: hdmi: increase maximum edid read retries

Some HDMI sinks may not have EDID ready immediately
after asserting HPD. Increasing the maximum number of
read retries of the first EDID block to ensure that
EDID read is successful.

Change-Id: Ia8e49f3e8f6beca84ecb584dcb40446a8657edb0
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
This commit is contained in:
Casey Piper 2014-11-04 17:35:55 -08:00 committed by David Keitel
parent acab8b7e1b
commit 3bfef91a9d

View file

@ -39,6 +39,8 @@
/* Support for first 5 EDID blocks */ /* Support for first 5 EDID blocks */
#define MAX_EDID_BLOCK_SIZE (0x80 * 5) #define MAX_EDID_BLOCK_SIZE (0x80 * 5)
#define MAX_EDID_READ_RETRY 5
#define BUFF_SIZE_3D 128 #define BUFF_SIZE_3D 128
enum data_block_types { enum data_block_types {
@ -541,7 +543,7 @@ static int hdmi_edid_read_block(struct hdmi_edid_ctrl *edid_ctrl, int block,
u32 ndx, check_sum, print_len; u32 ndx, check_sum, print_len;
int block_size; int block_size;
int i, status; int i, status;
int retry_cnt = 0; int retry_cnt = 0, checksum_retry = 0;
struct hdmi_tx_ddc_data ddc_data; struct hdmi_tx_ddc_data ddc_data;
b = edid_buf; b = edid_buf;
@ -579,8 +581,8 @@ read_retry:
if (status) if (status)
break; break;
} }
if (retry_cnt++ >= MAX_EDID_READ_RETRY)
block_size /= 2; block_size /= 2;
} while (status && (block_size >= 16)); } while (status && (block_size >= 16));
if (status) if (status)
@ -599,8 +601,9 @@ read_retry:
ndx, ndx+3, ndx, ndx+3,
b[ndx+0], b[ndx+1], b[ndx+2], b[ndx+3]); b[ndx+0], b[ndx+1], b[ndx+2], b[ndx+3]);
status = -EPROTO; status = -EPROTO;
if (retry_cnt++ < 3) { if (checksum_retry++ < 3) {
DEV_DBG("Retrying reading EDID %d time\n", retry_cnt); DEV_DBG("Retrying reading EDID %d time\n",
checksum_retry);
goto read_retry; goto read_retry;
} }
goto error; goto error;