From f5784d2722df6d09dcf09f13a316531bf80fa973 Mon Sep 17 00:00:00 2001 From: Per Persson Date: Mon, 4 Jul 2011 10:19:53 +0200 Subject: HDMIservice: Prepare for lbp build Makefile for building lbp is added. Compiler warnings are removed. ST-Ericsson ID: 350562 ST-Ericsson FOSS-OUT ID: STETL-FOSS-OUT-10177 Change-Id: I32dd6de5eeaedb0a9aaae7dfb3f0dc0713c8e2d5 Signed-off-by: Per Persson Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/26488 Reviewed-by: QATEST Reviewed-by: QATOOLS Reviewed-by: Robert LIND Reviewed-by: Jimmy RUBIN --- src/edid.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/edid.c') diff --git a/src/edid.c b/src/edid.c index adcab88..c0f0b4d 100644 --- a/src/edid.c +++ b/src/edid.c @@ -7,6 +7,7 @@ #include /* Symbolic Constants */ #include /* Primitive System Data Types */ +#include #include /* Errors */ #include #include /* Input/Output */ @@ -15,7 +16,9 @@ #include #include #include +#ifdef ANDROID #include +#endif #include "../include/hdmi_service_api.h" #include "../include/hdmi_service_local.h" @@ -164,7 +167,6 @@ int edid_read(__u8 block, __u8 *data) int size; LOGHDMILIB("EDID read blk %d", block); - /* Request edid block 0 */ edidread = open(EDIDREAD_FILE, O_RDWR); if (edidread < 0) { @@ -211,7 +213,6 @@ int edid_parse0(__u8 *data, __u8 *extension, struct video_format formats[], __u8 version; __u8 revision; __u8 est_timing; - int findex; int vesa_nr; int bit; int cnt; @@ -288,10 +289,12 @@ int edid_parse0(__u8 *data, __u8 *extension, struct video_format formats[], edidp = EDID_BL0_STDTIM1_OFFSET + index * 2; xres = (*(data + edidp) + 31) * 8; byte = *(data + edidp + 1); - ar_index = (byte * EDID_STDTIM_AR_MASK) >> EDID_STDTIM_AR_SHIFT; + ar_index = (byte & EDID_STDTIM_AR_MASK) >> EDID_STDTIM_AR_SHIFT; yres = xres * edid_stdtim_ar[ar_index].y / edid_stdtim_ar[ar_index].x; - freq = (byte * EDID_STDTIM_FREQ_MASK) >> EDID_STDTIM_FREQ_SHIFT; + freq = 60 + ((byte & EDID_STDTIM_FREQ_MASK) >> + EDID_STDTIM_FREQ_SHIFT); + LOGHDMILIB2("xres:%d yres:%d freq:%d", xres, yres, freq); vesa_nr = get_vesanr_from_std_timing(xres, yres, freq); if (vesa_nr < 1) continue; @@ -484,12 +487,14 @@ int edid_parse1(__u8 *data, struct video_format formats[], int nr_formats, edidp += EDID_BL1_STDTIM9_BYTE_START + index * 2; xres = (*(data + edidp) + 31) * 8; byte = *(data + edidp + 1); - ar_index = (byte * EDID_STDTIM_AR_MASK) >> + ar_index = (byte & EDID_STDTIM_AR_MASK) >> EDID_STDTIM_AR_SHIFT; yres = xres * edid_stdtim_ar[ar_index].y / edid_stdtim_ar[ar_index].x; - freq = (byte * EDID_STDTIM_FREQ_MASK) >> - EDID_STDTIM_FREQ_SHIFT; + freq = 60 + ((byte & EDID_STDTIM_FREQ_MASK) >> + EDID_STDTIM_FREQ_SHIFT); + LOGHDMILIB2("xres:%d yres:%d freq:%d", xres, yres, + freq); vesa_nr = get_vesanr_from_std_timing(xres, yres, freq); LOGHDMILIB2("StdTim9to16 try vesa_nr:%d", vesa_nr); for (cnt = 0; cnt < nr_formats; cnt++) { -- cgit v1.2.3