@@ -27,8 +27,6 @@
#include "dw_hdmi.h"
-#define HDMI_EDID_LEN 512
-
#define RGB 0
#define YCBCR444 1
#define YCBCR422_16BITS 2
@@ -116,8 +114,8 @@ struct dw_hdmi {
int vic;
- u8 edid[HDMI_EDID_LEN];
bool cable_plugin;
+ bool has_hdmi_monitor;
bool phy_enabled;
struct drm_display_mode previous_mode;
@@ -1182,13 +1180,10 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
hdmi->vic = drm_match_cea_mode(mode);
- if (!hdmi->vic) {
- dev_dbg(hdmi->dev, "Non-CEA mode used in HDMI\n");
- hdmi->hdmi_data.video_mode.mdvi = true;
- } else {
- dev_dbg(hdmi->dev, "CEA mode used vic=%d\n", hdmi->vic);
+ if (hdmi->has_hdmi_monitor && hdmi->vic)
hdmi->hdmi_data.video_mode.mdvi = false;
- }
+ else
+ hdmi->hdmi_data.video_mode.mdvi = true;
if ((hdmi->vic == 6) || (hdmi->vic == 7) ||
(hdmi->vic == 21) || (hdmi->vic == 22) ||
@@ -1237,7 +1232,7 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
if (hdmi->hdmi_data.video_mode.mdvi) {
dev_dbg(hdmi->dev, "%s DVI mode\n", __func__);
} else {
- dev_dbg(hdmi->dev, "%s CEA mode\n", __func__);
+ dev_dbg(hdmi->dev, "%s CEA mode VIC=%d\n", __func__, hdmi->vic);
/* HDMI Initialization Step E - Configure audio */
hdmi_clk_regenerator_update_pixel_clock(hdmi);
@@ -1411,9 +1406,11 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
drm_mode_connector_update_edid_property(connector, edid);
ret = drm_add_edid_modes(connector, edid);
+ hdmi->has_hdmi_monitor = drm_detect_hdmi_monitor(edid);
kfree(edid);
} else {
dev_dbg(hdmi->dev, "failed to get edid\n");
+ hdmi->has_hdmi_monitor = false;
}
return 0;