Commit 2b8d33f7 authored by ling.ma@intel.com's avatar ling.ma@intel.com Committed by Eric Anholt

drm/i915: Return disconnected for SDVO DVI when there's no digital EDID.

The patch fixed a bug on MP965-D.  When VGA is connected to a DVI-I connector,
it incorrectly shows sdvo dvi as connected.
Signed-off-by: default avatarMa Ling <ling.ma@intel.com>
[anholt: hand-resolved against previous commit and fixed up commit message]
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
parent fb7a46f3
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "drm.h" #include "drm.h"
#include "drm_crtc.h" #include "drm_crtc.h"
#include "intel_drv.h" #include "intel_drv.h"
#include "drm_edid.h"
#include "i915_drm.h" #include "i915_drm.h"
#include "i915_drv.h" #include "i915_drv.h"
#include "intel_sdvo_regs.h" #include "intel_sdvo_regs.h"
...@@ -1477,20 +1478,35 @@ intel_sdvo_multifunc_encoder(struct intel_output *intel_output) ...@@ -1477,20 +1478,35 @@ intel_sdvo_multifunc_encoder(struct intel_output *intel_output)
return (caps > 1); return (caps > 1);
} }
static void enum drm_connector_status
intel_sdvo_hdmi_sink_detect(struct drm_connector *connector) intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response)
{ {
struct intel_output *intel_output = to_intel_output(connector); struct intel_output *intel_output = to_intel_output(connector);
struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
enum drm_connector_status status = connector_status_connected;
struct edid *edid = NULL; struct edid *edid = NULL;
edid = drm_get_edid(&intel_output->base, edid = drm_get_edid(&intel_output->base,
intel_output->ddc_bus); intel_output->ddc_bus);
if (edid != NULL) { if (edid != NULL) {
sdvo_priv->is_hdmi = drm_detect_hdmi_monitor(edid); /* Don't report the output as connected if it's a DVI-I
* connector with a non-digital EDID coming out.
*/
if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) {
if (edid->input & DRM_EDID_INPUT_DIGITAL)
sdvo_priv->is_hdmi =
drm_detect_hdmi_monitor(edid);
else
status = connector_status_disconnected;
}
kfree(edid); kfree(edid);
intel_output->base.display_info.raw_edid = NULL; intel_output->base.display_info.raw_edid = NULL;
}
} else if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1))
status = connector_status_disconnected;
return status;
} }
static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connector) static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connector)
...@@ -1518,8 +1534,7 @@ static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connect ...@@ -1518,8 +1534,7 @@ static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connect
return connector_status_unknown; return connector_status_unknown;
sdvo_priv->attached_output = response; sdvo_priv->attached_output = response;
} }
intel_sdvo_hdmi_sink_detect(connector); return intel_sdvo_hdmi_sink_detect(connector, response);
return connector_status_connected;
} }
static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) static void intel_sdvo_get_ddc_modes(struct drm_connector *connector)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment