From 781c36475cf44240cdeedfe7ddb4c7fd5df3dfba Mon Sep 17 00:00:00 2001 From: Per Persson Date: Mon, 28 Nov 2011 11:32:43 +0100 Subject: HDMIservice: Improve EDID handling Requirement on CEA Extension header revision number match is removed in order to accept older monitors. HDMI support is determined by the revision number. ST-Ericsson ID: 401287 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I111e679b12eb240e2346bd674da768c5d1c5a526 Signed-off-by: Per Persson Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/40794 Reviewed-by: QATOOLS Reviewed-by: Robert LIND Reviewed-by: Jimmy RUBIN --- include/hdmi_service_local.h | 4 ++-- src/edid.c | 17 +++++++++-------- src/hdmi_service.c | 7 ++++++- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/include/hdmi_service_local.h b/include/hdmi_service_local.h index d6b8b74..9d5ff7e 100644 --- a/include/hdmi_service_local.h +++ b/include/hdmi_service_local.h @@ -88,7 +88,8 @@ int cecrx(void); int edid_read(__u8 block, __u8 *data); int edid_parse0(__u8 *data, __u8 *extension, struct video_format *, int size); int edid_parse1(__u8 *data, struct video_format formats[], int nr_formats, - int *basic_audio_support, struct edid_latency *edid_latency); + int *basic_audio_support, struct edid_latency *edid_latency, + int *hdmi); int edidreq(__u8 block, __u32 cmd_id); int hdcp_init(__u8 *aes); int hdcp_state(void); @@ -274,7 +275,6 @@ int hdmi_service_vesa_cea_prio_set(__u8 vesa_cea1, __u8 nr1, #define EDID_BL1_STDTIM9_3_FLAG_OFFSET 0x6C #define EDID_BL1_STDTIM9_BYTE_START 5 #define EDID_BL1_TAG_EXPECTED 0x02 -#define EDID_BL1_REV_EXPECTED 0x03 #define EDID_SVD_ID_MASK 0x7F #define EDID_EXTVER_3 0x03 #define EDID_NO_DATA 0x04 diff --git a/src/edid.c b/src/edid.c index befdf32..e3381e5 100644 --- a/src/edid.c +++ b/src/edid.c @@ -341,7 +341,8 @@ int edid_parse0(__u8 *data, __u8 *extension, struct video_format formats[], /* Parse EDID block 1 */ int edid_parse1(__u8 *data, struct video_format formats[], int nr_formats, - int *basic_audio_support, struct edid_latency *edid_latency) + int *basic_audio_support, struct edid_latency *edid_latency, + int *hdmi) { __u8 tag; __u8 rev; @@ -366,19 +367,19 @@ int edid_parse1(__u8 *data, struct video_format formats[], int nr_formats, tag = *(data + EDID_BL1_TAG_OFFSET); rev = *(data + EDID_BL1_REVNR_OFFSET); - if ((tag != EDID_BL1_TAG_EXPECTED) || rev != EDID_BL1_REV_EXPECTED) { - LOGHDMILIB("edid bl1 tag:%02x or rev:%02x invalid", tag, rev); + if (tag != EDID_BL1_TAG_EXPECTED) { + LOGHDMILIB("edid bl1 tag:%02x or rev:%02x", tag, rev); return EDIDREAD_BL1_TAG_REV_ERR; } + if (rev >= EDID_EXTVER_3) + *hdmi = 1; + else + *hdmi = 0; /* Only DVI */ + offset = *(data + EDID_BL1_OFFSET_OFFSET); LOGHDMILIB("rev:%d offset:%d", rev, offset); - if ((rev != EDID_EXTVER_3) || (offset == 0) || - (offset == EDID_NO_DATA)) { - LOGHDMILIB("%s", "No video block"); - return EDIDREAD_NOVIDEO; - } /* Check Audio support */ if (*(data + EDID_BL1_AUDIO_SUPPORT_OFFSET) & diff --git a/src/hdmi_service.c b/src/hdmi_service.c index fd2b174..0a64425 100644 --- a/src/hdmi_service.c +++ b/src/hdmi_service.c @@ -341,6 +341,7 @@ static int hdmiplugged_handle(int *basic_audio_support) int res; int ret = 0; enum hdmi_plug_state plug_state; + int hdmi_support = 0; LOGHDMILIB("%s", "HDMIEVENT_HDMIPLUGGED"); @@ -389,7 +390,8 @@ static int hdmiplugged_handle(int *basic_audio_support) if (res == 0) res = edid_parse1(data + 1, formats, nr_formats, basic_audio_support, - &edid_latency); + &edid_latency, + &hdmi_support); if (res && (cnt < 2)) usleep(EDIDREAD_WAITTIME1); cnt++; @@ -400,6 +402,9 @@ static int hdmiplugged_handle(int *basic_audio_support) goto hdmiplugged_handle_end; } + } + + if (hdmi_support) { /* Set hdmi format to hdmi */ hdmi_format_set(HDMI_FORMAT_HDMI); cea = 1; -- cgit v1.2.3