From d69648f044d0c5e4838c1b94a3876676c39f3e8d Mon Sep 17 00:00:00 2001 From: Ajay Singh Parmar Date: Thu, 10 Sep 2015 21:27:09 -0700 Subject: [PATCH] msm: mdss: hdmi: keep a default resolution for edid parser Reset supported HDMI resolutions list to contain at least a default resolution on EDID parser initialization and on each parser call. In corner cases of EDID read or parser failures, driver should expose a default resolution to other modules to continue with the HDMI initialization. Change-Id: I75cb78577d327c0f042238e10379585111d8fd70 Signed-off-by: Ajay Singh Parmar [cip@codeaurora.org: Resolved merge conflict] Signed-off-by: Clarence Ip --- drivers/video/fbdev/msm/mdss_hdmi_edid.c | 9 +++++++-- drivers/video/fbdev/msm/mdss_hdmi_edid.h | 3 ++- drivers/video/fbdev/msm/mdss_hdmi_tx.c | 5 +++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/video/fbdev/msm/mdss_hdmi_edid.c b/drivers/video/fbdev/msm/mdss_hdmi_edid.c index 25f58db02a9e..85852d91fb0f 100644 --- a/drivers/video/fbdev/msm/mdss_hdmi_edid.c +++ b/drivers/video/fbdev/msm/mdss_hdmi_edid.c @@ -122,6 +122,7 @@ struct hdmi_edid_ctrl { u16 physical_address; u32 video_resolution; /* selected by user */ u32 sink_mode; /* HDMI or DVI */ + u32 default_vic; u16 audio_latency; u16 video_latency; u32 present_3d; @@ -176,6 +177,8 @@ static int hdmi_edid_reset_parser(struct hdmi_edid_ctrl *edid_ctrl) edid_ctrl->adb_size = 0; edid_ctrl->sadb_size = 0; + hdmi_edid_set_video_resolution(edid_ctrl, edid_ctrl->default_vic, true); + /* reset new resolution details */ if (!edid_ctrl->keep_resv_timings) hdmi_reset_resv_timing_info(); @@ -2214,7 +2217,7 @@ int hdmi_edid_get_audio_blk(void *input, struct msm_hdmi_audio_edid_blk *blk) return 0; } /* hdmi_edid_get_audio_blk */ -void hdmi_edid_set_video_resolution(void *input, u32 resolution) +void hdmi_edid_set_video_resolution(void *input, u32 resolution, bool reset) { struct hdmi_edid_ctrl *edid_ctrl = (struct hdmi_edid_ctrl *)input; @@ -2225,7 +2228,9 @@ void hdmi_edid_set_video_resolution(void *input, u32 resolution) edid_ctrl->video_resolution = resolution; - if (1 == edid_ctrl->sink_data.num_of_elements) { + if (reset) { + edid_ctrl->default_vic = resolution; + edid_ctrl->sink_data.num_of_elements = 1; edid_ctrl->sink_data.disp_mode_list[0].video_format = resolution; edid_ctrl->sink_data.disp_mode_list[0].rgb_support = true; diff --git a/drivers/video/fbdev/msm/mdss_hdmi_edid.h b/drivers/video/fbdev/msm/mdss_hdmi_edid.h index 87c2e88aa96b..989b8c267349 100644 --- a/drivers/video/fbdev/msm/mdss_hdmi_edid.h +++ b/drivers/video/fbdev/msm/mdss_hdmi_edid.h @@ -36,7 +36,8 @@ bool hdmi_edid_get_sink_scrambler_support(void *input); bool hdmi_edid_get_scdc_support(void *input); int hdmi_edid_get_audio_blk(void *edid_ctrl, struct msm_hdmi_audio_edid_blk *blk); -void hdmi_edid_set_video_resolution(void *edid_ctrl, u32 resolution); +void hdmi_edid_set_video_resolution(void *edid_ctrl, u32 resolution, + bool reset); void hdmi_edid_deinit(void *edid_ctrl); void *hdmi_edid_init(struct hdmi_edid_init_data *init_data); diff --git a/drivers/video/fbdev/msm/mdss_hdmi_tx.c b/drivers/video/fbdev/msm/mdss_hdmi_tx.c index c204f47df0fc..48733daef080 100644 --- a/drivers/video/fbdev/msm/mdss_hdmi_tx.c +++ b/drivers/video/fbdev/msm/mdss_hdmi_tx.c @@ -1431,7 +1431,7 @@ static int hdmi_tx_init_features(struct hdmi_tx_ctrl *hdmi_ctrl, hdmi_edid_set_video_resolution( hdmi_ctrl->feature_data[HDMI_TX_FEAT_EDID], - hdmi_ctrl->vid_cfg.vic); + hdmi_ctrl->vid_cfg.vic, true); /* Initialize HDCP features */ res = platform_get_resource_byname(hdmi_ctrl->pdev, @@ -1784,7 +1784,8 @@ static int hdmi_tx_set_video_fmt(struct hdmi_tx_ctrl *hdmi_ctrl, (vid_cfg->timing.pixel_freq * 1000) >> div; hdmi_edid_set_video_resolution( - hdmi_ctrl->feature_data[HDMI_TX_FEAT_EDID], vid_cfg->vic); + hdmi_ctrl->feature_data[HDMI_TX_FEAT_EDID], + vid_cfg->vic, false); return res_changed; } /* hdmi_tx_set_video_fmt */