diff options
| author | Ajay Singh Parmar <aparmar@codeaurora.org> | 2015-02-05 15:02:46 -0800 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:38:07 -0700 |
| commit | ac448902cf458b546bed6559a39ef17ad0b07a4d (patch) | |
| tree | d26ff9aa40201dc1a7d4801e683a4c48c122dd99 | |
| parent | 38b475900878d9e72e198d9adc8d1daa7c638cc5 (diff) | |
msm: mdss: hdmi: optimize DTD resolution parsing
DTD (Detailed Timing Descriptor) provides full resolution timing
details. Currently we compare these details with our resolution
data base to find a match. This is not needed as DTD has complete
details. Once parsing of resolution is done, just add this as a
new resolution.
Change-Id: I0d6c101c96a6bc8c0ff8fe63c17bf233d52dad7f
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_hdmi_edid.c | 70 | ||||
| -rw-r--r-- | include/uapi/video/msm_hdmi_modes.h | 1 |
2 files changed, 18 insertions, 53 deletions
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_edid.c b/drivers/video/fbdev/msm/mdss_hdmi_edid.c index 6dd5818613a9..18215f68ea60 100644 --- a/drivers/video/fbdev/msm/mdss_hdmi_edid.c +++ b/drivers/video/fbdev/msm/mdss_hdmi_edid.c @@ -1113,7 +1113,6 @@ static void hdmi_edid_detail_desc(struct hdmi_edid_ctrl *edid_ctrl, u32 active_v = 0; u32 blank_h = 0; u32 blank_v = 0; - u32 ndx = 0; u32 img_size_h = 0; u32 img_size_v = 0; u32 pixel_clk = 0; @@ -1124,6 +1123,10 @@ static void hdmi_edid_detail_desc(struct hdmi_edid_ctrl *edid_ctrl, u32 active_low_h = 0; u32 active_low_v = 0; + struct msm_hdmi_mode_timing_info timing = {0}; + u64 rr_tmp, frame_data; + int rc; + /* * Pixel clock/ 10,000 * LSB stored in byte 0 and MSB stored in byte 1 @@ -1241,54 +1244,10 @@ static void hdmi_edid_detail_desc(struct hdmi_edid_ctrl *edid_ctrl, active_h, active_v, blank_h, blank_v, img_size_h, img_size_v, interlaced ? "i" : "p"); - *disp_mode = HDMI_VFRMT_FORCE_32BIT; - for (ndx = HDMI_VFRMT_UNKNOWN + 1; ndx < HDMI_VFRMT_MAX; ndx++) { - struct msm_hdmi_mode_timing_info timing = {0}; - u32 ret = hdmi_get_supported_mode(&timing, - edid_ctrl->init_data.ds_data, - ndx); - - if (ret || !timing.supported) - continue; - - if ((interlaced == timing.interlaced) && - (active_h == timing.active_h) && - (blank_h == (timing.front_porch_h + - timing.pulse_width_h + - timing.back_porch_h)) && - (blank_v == (timing.front_porch_v + - timing.pulse_width_v + - timing.back_porch_v)) && - ((active_v == timing.active_v) || - (active_v == (timing.active_v + 1)))) { - *disp_mode = timing.video_format; - - /* - * There can be 16:9 and 4:3 aspect ratio of same - * timing details. Continue searching in case aspect - * ratio didn't match but rest of timing details do. - */ - - if (aspect_ratio_4_3 && - (timing.ar != HDMI_RES_AR_4_3)) - continue; - else if (!aspect_ratio_4_3 && - (timing.ar == HDMI_RES_AR_4_3)) - continue; - else - break; - } - } - - if (*disp_mode == HDMI_VFRMT_FORCE_32BIT) { - struct msm_hdmi_mode_timing_info timing = {0}; - u64 rr_tmp = pixel_clk * 1000 * 1000; - u64 frame_data = (blank_h + active_h) * - (blank_v + active_v); - int rc = 0; - - DEV_DBG("%s: found new mode\n", __func__); + rr_tmp = pixel_clk * 1000 * 1000; + frame_data = (blank_h + active_h) * (blank_v + active_v); + if (frame_data) { do_div(rr_tmp, frame_data); timing.active_h = active_h; @@ -1309,13 +1268,20 @@ static void hdmi_edid_detail_desc(struct hdmi_edid_ctrl *edid_ctrl, timing.supported = true; timing.ar = aspect_ratio_4_3 ? HDMI_RES_AR_4_3 : (aspect_ratio_5_4 ? HDMI_RES_AR_5_4 : - HDMI_RES_AR_16_9); + HDMI_RES_AR_16_9); rc = hdmi_set_resv_timing_info(&timing); - if (!IS_ERR_VALUE(rc)) - *disp_mode = rc; } else { - DEV_DBG("%s: mode found:%d\n", __func__, *disp_mode); + DEV_ERR("%s: Invalid frame data\n", __func__); + rc = -EINVAL; + } + + if (!IS_ERR_VALUE(rc)) { + *disp_mode = rc; + DEV_DBG("%s: DTD mode found: %d\n", __func__, *disp_mode); + } else { + *disp_mode = HDMI_VFRMT_UNKNOWN; + DEV_ERR("%s: error adding mode from DTD: %d\n", __func__, rc); } } /* hdmi_edid_detail_desc */ diff --git a/include/uapi/video/msm_hdmi_modes.h b/include/uapi/video/msm_hdmi_modes.h index 7b138101fbec..085b3150d322 100644 --- a/include/uapi/video/msm_hdmi_modes.h +++ b/include/uapi/video/msm_hdmi_modes.h @@ -188,7 +188,6 @@ struct msm_hdmi_mode_timing_info { #define RESERVE_VFRMT_END HDMI_VFRMT_RESERVE8 #define HDMI_VFRMT_MAX (RESERVE_VFRMT_END + 1) -#define HDMI_VFRMT_FORCE_32BIT 0x7FFFFFFF /* Timing information for supported modes */ #define VFRMT_NOT_SUPPORTED(VFRMT) \ |
