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>
This commit is contained in:
Aravind Venkateswaran 2017-03-10 15:30:46 -08:00 committed by Gerrit - the friendly Code Review server
parent f120e77b9a
commit b0d01164be
3 changed files with 28 additions and 3 deletions

View file

@ -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:

View file

@ -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;

View file

@ -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__ */