msm: mdss: sink mode needs to be read from EDID
DVI/HDMI mode of sink could be read from EDID. Now, we set the mode according to the video format. For a HDMI device, if we choose VIC mode larger than 127, it would be set as DVI mode. It would be confused that a HDMI device is treated as a DVI device, and would lead some issue for display. CRs-Fixed: 2030216 Change-Id: I122faf6f4f8d7e620bc6ce7ce1b5757caa188b8e Signed-off-by: zhaoyuan <yzhao@codeaurora.org>
This commit is contained in:
parent
d9fbe4b921
commit
d2df88ebbc
4 changed files with 19 additions and 37 deletions
|
@ -576,6 +576,7 @@ int mdss_dba_utils_video_on(void *data, struct mdss_panel_info *pinfo)
|
||||||
video_cfg.h_pulse_width = pinfo->lcdc.h_pulse_width;
|
video_cfg.h_pulse_width = pinfo->lcdc.h_pulse_width;
|
||||||
video_cfg.v_pulse_width = pinfo->lcdc.v_pulse_width;
|
video_cfg.v_pulse_width = pinfo->lcdc.v_pulse_width;
|
||||||
video_cfg.pclk_khz = (unsigned long)pinfo->clk_rate / 1000;
|
video_cfg.pclk_khz = (unsigned long)pinfo->clk_rate / 1000;
|
||||||
|
video_cfg.hdmi_mode = !hdmi_edid_is_dvi_mode(ud->edid_data);
|
||||||
|
|
||||||
/* Calculate number of DSI lanes configured */
|
/* Calculate number of DSI lanes configured */
|
||||||
video_cfg.num_of_input_lanes = 0;
|
video_cfg.num_of_input_lanes = 0;
|
||||||
|
@ -591,8 +592,6 @@ int mdss_dba_utils_video_on(void *data, struct mdss_panel_info *pinfo)
|
||||||
/* Get scan information from EDID */
|
/* Get scan information from EDID */
|
||||||
video_cfg.vic = mdss_dba_get_vic_panel_info(ud, pinfo);
|
video_cfg.vic = mdss_dba_get_vic_panel_info(ud, pinfo);
|
||||||
ud->current_vic = video_cfg.vic;
|
ud->current_vic = video_cfg.vic;
|
||||||
video_cfg.hdmi_mode = hdmi_edid_get_sink_mode(ud->edid_data,
|
|
||||||
video_cfg.vic);
|
|
||||||
video_cfg.scaninfo = hdmi_edid_get_sink_scaninfo(ud->edid_data,
|
video_cfg.scaninfo = hdmi_edid_get_sink_scaninfo(ud->edid_data,
|
||||||
video_cfg.vic);
|
video_cfg.vic);
|
||||||
if (ud->ops.video_on)
|
if (ud->ops.video_on)
|
||||||
|
|
|
@ -62,6 +62,11 @@
|
||||||
#define EDID_VENDOR_ID_SIZE 4
|
#define EDID_VENDOR_ID_SIZE 4
|
||||||
#define EDID_IEEE_REG_ID 0x0c03
|
#define EDID_IEEE_REG_ID 0x0c03
|
||||||
|
|
||||||
|
enum edid_sink_mode {
|
||||||
|
SINK_MODE_DVI,
|
||||||
|
SINK_MODE_HDMI
|
||||||
|
};
|
||||||
|
|
||||||
enum luminance_value {
|
enum luminance_value {
|
||||||
NO_LUMINANCE_DATA = 3,
|
NO_LUMINANCE_DATA = 3,
|
||||||
MAXIMUM_LUMINANCE = 4,
|
MAXIMUM_LUMINANCE = 4,
|
||||||
|
@ -2418,7 +2423,7 @@ end:
|
||||||
return scaninfo;
|
return scaninfo;
|
||||||
} /* hdmi_edid_get_sink_scaninfo */
|
} /* hdmi_edid_get_sink_scaninfo */
|
||||||
|
|
||||||
u32 hdmi_edid_get_sink_mode(void *input, u32 mode)
|
static u32 hdmi_edid_get_sink_mode(void *input)
|
||||||
{
|
{
|
||||||
struct hdmi_edid_ctrl *edid_ctrl = (struct hdmi_edid_ctrl *)input;
|
struct hdmi_edid_ctrl *edid_ctrl = (struct hdmi_edid_ctrl *)input;
|
||||||
bool sink_mode;
|
bool sink_mode;
|
||||||
|
@ -2431,13 +2436,8 @@ u32 hdmi_edid_get_sink_mode(void *input, u32 mode)
|
||||||
if (edid_ctrl->edid_override &&
|
if (edid_ctrl->edid_override &&
|
||||||
(edid_ctrl->override_data.sink_mode != -1))
|
(edid_ctrl->override_data.sink_mode != -1))
|
||||||
sink_mode = edid_ctrl->override_data.sink_mode;
|
sink_mode = edid_ctrl->override_data.sink_mode;
|
||||||
else {
|
|
||||||
if (edid_ctrl->sink_mode &&
|
|
||||||
(mode > 0 && mode <= HDMI_EVFRMT_END))
|
|
||||||
sink_mode = SINK_MODE_HDMI;
|
|
||||||
else
|
else
|
||||||
sink_mode = SINK_MODE_DVI;
|
sink_mode = edid_ctrl->sink_mode;
|
||||||
}
|
|
||||||
|
|
||||||
return sink_mode;
|
return sink_mode;
|
||||||
} /* hdmi_edid_get_sink_mode */
|
} /* hdmi_edid_get_sink_mode */
|
||||||
|
@ -2452,21 +2452,10 @@ u32 hdmi_edid_get_sink_mode(void *input, u32 mode)
|
||||||
*/
|
*/
|
||||||
bool hdmi_edid_is_dvi_mode(void *input)
|
bool hdmi_edid_is_dvi_mode(void *input)
|
||||||
{
|
{
|
||||||
struct hdmi_edid_ctrl *edid_ctrl = (struct hdmi_edid_ctrl *)input;
|
if (hdmi_edid_get_sink_mode(input))
|
||||||
int sink_mode;
|
return false;
|
||||||
|
|
||||||
if (!edid_ctrl) {
|
|
||||||
DEV_ERR("%s: invalid input\n", __func__);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (edid_ctrl->edid_override &&
|
|
||||||
(edid_ctrl->override_data.sink_mode != -1))
|
|
||||||
sink_mode = edid_ctrl->override_data.sink_mode;
|
|
||||||
else
|
else
|
||||||
sink_mode = edid_ctrl->sink_mode;
|
return true;
|
||||||
|
|
||||||
return (sink_mode == SINK_MODE_DVI);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -58,16 +58,10 @@ struct hdmi_edid_override_data {
|
||||||
int vic;
|
int vic;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum edid_sink_mode {
|
|
||||||
SINK_MODE_DVI,
|
|
||||||
SINK_MODE_HDMI
|
|
||||||
};
|
|
||||||
|
|
||||||
int hdmi_edid_parser(void *edid_ctrl);
|
int hdmi_edid_parser(void *edid_ctrl);
|
||||||
u32 hdmi_edid_get_raw_data(void *edid_ctrl, u8 *buf, u32 size);
|
u32 hdmi_edid_get_raw_data(void *edid_ctrl, u8 *buf, u32 size);
|
||||||
u8 hdmi_edid_get_sink_scaninfo(void *edid_ctrl, u32 resolution);
|
u8 hdmi_edid_get_sink_scaninfo(void *edid_ctrl, u32 resolution);
|
||||||
bool hdmi_edid_is_dvi_mode(void *input);
|
bool hdmi_edid_is_dvi_mode(void *input);
|
||||||
u32 hdmi_edid_get_sink_mode(void *edid_ctrl, u32 mode);
|
|
||||||
bool hdmi_edid_sink_scramble_override(void *input);
|
bool hdmi_edid_sink_scramble_override(void *input);
|
||||||
bool hdmi_edid_get_sink_scrambler_support(void *input);
|
bool hdmi_edid_get_sink_scrambler_support(void *input);
|
||||||
bool hdmi_edid_get_scdc_support(void *input);
|
bool hdmi_edid_get_scdc_support(void *input);
|
||||||
|
|
|
@ -375,12 +375,11 @@ static void hdmi_tx_audio_setup(struct hdmi_tx_ctrl *hdmi_ctrl)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool hdmi_tx_is_dvi_mode(struct hdmi_tx_ctrl *hdmi_ctrl)
|
static inline u32 hdmi_tx_is_dvi_mode(struct hdmi_tx_ctrl *hdmi_ctrl)
|
||||||
{
|
{
|
||||||
void *data = hdmi_tx_get_fd(HDMI_TX_FEAT_EDID);
|
void *data = hdmi_tx_get_fd(HDMI_TX_FEAT_EDID);
|
||||||
|
|
||||||
return (hdmi_edid_get_sink_mode(data,
|
return hdmi_edid_is_dvi_mode(data);
|
||||||
hdmi_ctrl->vic) == SINK_MODE_DVI);
|
|
||||||
} /* hdmi_tx_is_dvi_mode */
|
} /* hdmi_tx_is_dvi_mode */
|
||||||
|
|
||||||
static inline u32 hdmi_tx_is_in_splash(struct hdmi_tx_ctrl *hdmi_ctrl)
|
static inline u32 hdmi_tx_is_in_splash(struct hdmi_tx_ctrl *hdmi_ctrl)
|
||||||
|
@ -2482,8 +2481,7 @@ static void hdmi_tx_set_mode(struct hdmi_tx_ctrl *hdmi_ctrl, u32 power_on)
|
||||||
hdmi_ctrl_reg |= BIT(2);
|
hdmi_ctrl_reg |= BIT(2);
|
||||||
|
|
||||||
/* Set transmission mode to DVI based in EDID info */
|
/* Set transmission mode to DVI based in EDID info */
|
||||||
if (hdmi_edid_get_sink_mode(data,
|
if (hdmi_edid_is_dvi_mode(data))
|
||||||
hdmi_ctrl->vic) == SINK_MODE_DVI)
|
|
||||||
hdmi_ctrl_reg &= ~BIT(1); /* DVI mode */
|
hdmi_ctrl_reg &= ~BIT(1); /* DVI mode */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2942,6 +2940,7 @@ static int hdmi_tx_audio_info_setup(struct platform_device *pdev,
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
struct hdmi_tx_ctrl *hdmi_ctrl = platform_get_drvdata(pdev);
|
struct hdmi_tx_ctrl *hdmi_ctrl = platform_get_drvdata(pdev);
|
||||||
|
u32 is_mode_dvi;
|
||||||
|
|
||||||
if (!hdmi_ctrl || !params) {
|
if (!hdmi_ctrl || !params) {
|
||||||
DEV_ERR("%s: invalid input\n", __func__);
|
DEV_ERR("%s: invalid input\n", __func__);
|
||||||
|
@ -2950,8 +2949,9 @@ static int hdmi_tx_audio_info_setup(struct platform_device *pdev,
|
||||||
|
|
||||||
mutex_lock(&hdmi_ctrl->tx_lock);
|
mutex_lock(&hdmi_ctrl->tx_lock);
|
||||||
|
|
||||||
if (!hdmi_tx_is_dvi_mode(hdmi_ctrl) &&
|
is_mode_dvi = hdmi_tx_is_dvi_mode(hdmi_ctrl);
|
||||||
hdmi_tx_is_panel_on(hdmi_ctrl)) {
|
|
||||||
|
if (!is_mode_dvi && hdmi_tx_is_panel_on(hdmi_ctrl)) {
|
||||||
memcpy(&hdmi_ctrl->audio_params, params,
|
memcpy(&hdmi_ctrl->audio_params, params,
|
||||||
sizeof(struct msm_ext_disp_audio_setup_params));
|
sizeof(struct msm_ext_disp_audio_setup_params));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue