diff options
author | ling.ma@intel.com <ling.ma@intel.com> | 2009-07-28 23:31:18 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-07-30 13:05:12 -0400 |
commit | 2b8d33f714477d1719f96459370037993520de84 (patch) | |
tree | 72645d9c8b4c4e454e84d8a160eaa95c07145325 | |
parent | fb7a46f3cc7d7dcf7c5edb3a38c84e3f730d7adb (diff) |
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: Ma Ling <ling.ma@intel.com>
[anholt: hand-resolved against previous commit and fixed up commit message]
Signed-off-by: Eric Anholt <eric@anholt.net>
-rw-r--r-- | drivers/gpu/drm/i915/intel_sdvo.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index b68746f0380e..5371d9332554 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include "drm.h" | 31 | #include "drm.h" |
32 | #include "drm_crtc.h" | 32 | #include "drm_crtc.h" |
33 | #include "intel_drv.h" | 33 | #include "intel_drv.h" |
34 | #include "drm_edid.h" | ||
34 | #include "i915_drm.h" | 35 | #include "i915_drm.h" |
35 | #include "i915_drv.h" | 36 | #include "i915_drv.h" |
36 | #include "intel_sdvo_regs.h" | 37 | #include "intel_sdvo_regs.h" |
@@ -1477,20 +1478,35 @@ intel_sdvo_multifunc_encoder(struct intel_output *intel_output) | |||
1477 | return (caps > 1); | 1478 | return (caps > 1); |
1478 | } | 1479 | } |
1479 | 1480 | ||
1480 | static void | 1481 | enum drm_connector_status |
1481 | intel_sdvo_hdmi_sink_detect(struct drm_connector *connector) | 1482 | intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response) |
1482 | { | 1483 | { |
1483 | struct intel_output *intel_output = to_intel_output(connector); | 1484 | struct intel_output *intel_output = to_intel_output(connector); |
1484 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | 1485 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; |
1486 | enum drm_connector_status status = connector_status_connected; | ||
1485 | struct edid *edid = NULL; | 1487 | struct edid *edid = NULL; |
1486 | 1488 | ||
1487 | edid = drm_get_edid(&intel_output->base, | 1489 | edid = drm_get_edid(&intel_output->base, |
1488 | intel_output->ddc_bus); | 1490 | intel_output->ddc_bus); |
1489 | if (edid != NULL) { | 1491 | if (edid != NULL) { |
1490 | sdvo_priv->is_hdmi = drm_detect_hdmi_monitor(edid); | 1492 | /* Don't report the output as connected if it's a DVI-I |
1493 | * connector with a non-digital EDID coming out. | ||
1494 | */ | ||
1495 | if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) { | ||
1496 | if (edid->input & DRM_EDID_INPUT_DIGITAL) | ||
1497 | sdvo_priv->is_hdmi = | ||
1498 | drm_detect_hdmi_monitor(edid); | ||
1499 | else | ||
1500 | status = connector_status_disconnected; | ||
1501 | } | ||
1502 | |||
1491 | kfree(edid); | 1503 | kfree(edid); |
1492 | intel_output->base.display_info.raw_edid = NULL; | 1504 | intel_output->base.display_info.raw_edid = NULL; |
1493 | } | 1505 | |
1506 | } else if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) | ||
1507 | status = connector_status_disconnected; | ||
1508 | |||
1509 | return status; | ||
1494 | } | 1510 | } |
1495 | 1511 | ||
1496 | static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connector) | 1512 | 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 | return connector_status_unknown; | 1534 | return connector_status_unknown; |
1519 | sdvo_priv->attached_output = response; | 1535 | sdvo_priv->attached_output = response; |
1520 | } | 1536 | } |
1521 | intel_sdvo_hdmi_sink_detect(connector); | 1537 | return intel_sdvo_hdmi_sink_detect(connector, response); |
1522 | return connector_status_connected; | ||
1523 | } | 1538 | } |
1524 | 1539 | ||
1525 | static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) | 1540 | static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) |