Merge tag 'drm-intel-next-2018-09-06-2' of git://anongit.freedesktop.org/drm/drm...
[sfrench/cifs-2.6.git] / drivers / gpu / drm / i915 / intel_hdmi.c
index 192972a7d287e9fd5ff9aeb599d6730007383500..a2dab0b6bde6a6a1034b8dcc76c27e03b1004f27 100644 (file)
@@ -1911,22 +1911,26 @@ intel_hdmi_set_edid(struct drm_connector *connector)
 static enum drm_connector_status
 intel_hdmi_detect(struct drm_connector *connector, bool force)
 {
 static enum drm_connector_status
 intel_hdmi_detect(struct drm_connector *connector, bool force)
 {
-       enum drm_connector_status status;
+       enum drm_connector_status status = connector_status_disconnected;
        struct drm_i915_private *dev_priv = to_i915(connector->dev);
        struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
        struct drm_i915_private *dev_priv = to_i915(connector->dev);
        struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
+       struct intel_encoder *encoder = &hdmi_to_dig_port(intel_hdmi)->base;
 
        DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
                      connector->base.id, connector->name);
 
        intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS);
 
 
        DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
                      connector->base.id, connector->name);
 
        intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS);
 
+       if (IS_ICELAKE(dev_priv) &&
+           !intel_digital_port_connected(encoder))
+               goto out;
+
        intel_hdmi_unset_edid(connector);
 
        if (intel_hdmi_set_edid(connector))
                status = connector_status_connected;
        intel_hdmi_unset_edid(connector);
 
        if (intel_hdmi_set_edid(connector))
                status = connector_status_connected;
-       else
-               status = connector_status_disconnected;
 
 
+out:
        intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS);
 
        if (status != connector_status_connected)
        intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS);
 
        if (status != connector_status_connected)