diff options
| author | Aravind Venkateswaran <aravindh@codeaurora.org> | 2017-03-10 15:30:46 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-03-15 23:05:00 -0700 |
| commit | b0d01164be80db1ca68f9323539c51fcbc81e78f (patch) | |
| tree | 755d224852302f5454ddbcac62d22401615f8e42 | |
| parent | f120e77b9ae360e88a0074eb5c522a114e781049 (diff) | |
msm: mdss: dp: fix check for audio support on the sink
The CEA extension block in the EDID data contains a field which
specifies whether the sink supports basic audio. Ensure to read
this field in addition to the audio data blocks to decide if
audio should be routed to the sink or not.
CRs-Fixed: 2014586
Change-Id: I556d4bc0b2c95bdf7fd24fd11eafb96394bf03af
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dp.c | 10 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_hdmi_edid.c | 20 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_hdmi_edid.h | 1 |
3 files changed, 28 insertions, 3 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dp.c b/drivers/video/fbdev/msm/mdss_dp.c index e961b7b78464..6117aff36849 100644 --- a/drivers/video/fbdev/msm/mdss_dp.c +++ b/drivers/video/fbdev/msm/mdss_dp.c @@ -1013,9 +1013,10 @@ static int dp_get_cable_status(struct platform_device *pdev, u32 vote) return hpd; } -static bool mdss_dp_is_dvi_mode(struct mdss_dp_drv_pdata *dp) +static bool mdss_dp_sink_audio_supp(struct mdss_dp_drv_pdata *dp) { - return hdmi_edid_is_dvi_mode(dp->panel_data.panel_info.edid_data); + return hdmi_edid_is_audio_supported( + dp->panel_data.panel_info.edid_data); } static int dp_audio_info_setup(struct platform_device *pdev, @@ -1706,14 +1707,17 @@ static int mdss_dp_send_audio_notification( goto end; } - if (!mdss_dp_is_dvi_mode(dp) || dp->audio_test_req) { + if (mdss_dp_sink_audio_supp(dp) || dp->audio_test_req) { dp->audio_test_req = false; + pr_debug("sending audio notification\n"); flags |= MSM_EXT_DISP_HPD_AUDIO; if (dp->ext_audio_data.intf_ops.hpd) ret = dp->ext_audio_data.intf_ops.hpd(dp->ext_pdev, dp->ext_audio_data.type, val, flags); + } else { + pr_debug("sink does not support audio\n"); } end: diff --git a/drivers/video/fbdev/msm/mdss_hdmi_edid.c b/drivers/video/fbdev/msm/mdss_hdmi_edid.c index 6bf8e581326d..502bc1570609 100644 --- a/drivers/video/fbdev/msm/mdss_hdmi_edid.c +++ b/drivers/video/fbdev/msm/mdss_hdmi_edid.c @@ -137,6 +137,7 @@ struct hdmi_edid_ctrl { u16 video_latency; u32 present_3d; u32 page_id; + bool basic_audio_supp; u8 audio_data_block[MAX_NUMBER_ADB * MAX_AUDIO_DATA_BLOCK_SIZE]; int adb_size; u8 spkr_alloc_data_block[MAX_SPKR_ALLOC_DATA_BLOCK_SIZE]; @@ -1289,6 +1290,14 @@ static void hdmi_edid_extract_sink_caps(struct hdmi_edid_ctrl *edid_ctrl, return; } + /* Check if sink supports basic audio */ + if (in_buf[3] & BIT(6)) + edid_ctrl->basic_audio_supp = true; + else + edid_ctrl->basic_audio_supp = false; + pr_debug("%s: basic audio supported: %s\n", __func__, + edid_ctrl->basic_audio_supp ? "true" : "false"); + vsd = hdmi_edid_find_hfvsdb(in_buf); if (vsd) { @@ -2627,6 +2636,17 @@ void hdmi_edid_set_max_pclk_rate(void *input, u32 max_pclk_khz) edid_ctrl->init_data.max_pclk_khz = max_pclk_khz; } +bool hdmi_edid_is_audio_supported(void *input) +{ + struct hdmi_edid_ctrl *edid_ctrl = (struct hdmi_edid_ctrl *)input; + + /* + * return true if basic audio is supported or if an audio + * data block was successfully parsed. + */ + return (edid_ctrl->basic_audio_supp || edid_ctrl->adb_size); +} + void hdmi_edid_deinit(void *input) { struct hdmi_edid_ctrl *edid_ctrl = (struct hdmi_edid_ctrl *)input; diff --git a/drivers/video/fbdev/msm/mdss_hdmi_edid.h b/drivers/video/fbdev/msm/mdss_hdmi_edid.h index 653276683981..557e9326a81d 100644 --- a/drivers/video/fbdev/msm/mdss_hdmi_edid.h +++ b/drivers/video/fbdev/msm/mdss_hdmi_edid.h @@ -80,5 +80,6 @@ void hdmi_edid_get_hdr_data(void *edid_ctrl, void hdmi_edid_config_override(void *input, bool enable, struct hdmi_edid_override_data *data); void hdmi_edid_set_max_pclk_rate(void *input, u32 max_pclk_khz); +bool hdmi_edid_is_audio_supported(void *input); #endif /* __HDMI_EDID_H__ */ |
