summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/dc/hdmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/tegra/dc/hdmi.c')
-rw-r--r--drivers/video/tegra/dc/hdmi.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c
index 55d9163d4faf..225d48ab15ee 100644
--- a/drivers/video/tegra/dc/hdmi.c
+++ b/drivers/video/tegra/dc/hdmi.c
@@ -1258,6 +1258,9 @@ static bool tegra_dc_hdmi_valid_asp_ratio(const struct tegra_dc *dc,
int m_aspratio = 0;
int s_aspratio = 0;
+ if (!mode->yres)
+ return false;
+
/* To check the aspect upto two decimal digits, calculate in % */
m_aspratio = (mode->xres*100 / mode->yres);
@@ -1345,7 +1348,8 @@ void tegra_dc_hdmi_detect_config(struct tegra_dc *dc,
hdmi->dvi = !(specs->misc & FB_MISC_HDMI);
- tegra_fb_update_monspecs(dc->fb, specs, tegra_dc_hdmi_mode_filter);
+ if (dc->fb != NULL)
+ tegra_fb_update_monspecs(dc->fb, specs, tegra_dc_hdmi_mode_filter);
#ifdef CONFIG_SWITCH
hdmi->hpd_switch.state = 0;
switch_set_state(&hdmi->hpd_switch, 1);
@@ -1413,11 +1417,18 @@ static bool tegra_dc_hdmi_detect(struct tegra_dc *dc)
struct tegra_dc_hdmi_data *hdmi = tegra_dc_get_outdata(dc);
struct fb_monspecs specs;
int err;
+ int cnt = 0;
if (!tegra_dc_hdmi_hpd(dc))
goto fail;
err = tegra_edid_get_monspecs(hdmi->edid, &specs);
+ /* retry, maybe hdmi detect is not debounced or the monitor needs some time */
+ while ( (err < 0) && (cnt++ < 4) ) {
+ dev_err(&dc->ndev->dev, "error reading edid, trying again in 500ms\n");
+ msleep(500);
+ err = tegra_edid_get_monspecs(hdmi->edid, &specs);
+ }
if (err < 0) {
if (dc->out->n_modes)
tegra_dc_enable(dc);