aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-05-05 12:52:46 -0400
committerKeith Packard <keithp@keithp.com>2009-06-18 17:59:01 -0400
commitaa93d632c496184e5b779dbcf961bf1c6ececf0b (patch)
tree27556202ab20158e59629fbfb870120a72f20fa0
parent52dc7d32b88156248167864f77a9026abe27b432 (diff)
drm/i915: Require digital monitor on HDMI ports for detect
HDMI and DVI both require DDC/EDID on monitors, so use that to know when a monitor is connected as the hot-plug pins are shared with SDVO and DisplayPort Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 4ea2a651b92c..2495359ea8de 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -31,6 +31,7 @@
31#include "drmP.h" 31#include "drmP.h"
32#include "drm.h" 32#include "drm.h"
33#include "drm_crtc.h" 33#include "drm_crtc.h"
34#include "drm_edid.h"
34#include "intel_drv.h" 35#include "intel_drv.h"
35#include "i915_drm.h" 36#include "i915_drm.h"
36#include "i915_drv.h" 37#include "i915_drv.h"
@@ -129,20 +130,26 @@ static bool intel_hdmi_mode_fixup(struct drm_encoder *encoder,
129 return true; 130 return true;
130} 131}
131 132
132static void 133static enum drm_connector_status
133intel_hdmi_sink_detect(struct drm_connector *connector) 134intel_hdmi_edid_detect(struct drm_connector *connector)
134{ 135{
135 struct intel_output *intel_output = to_intel_output(connector); 136 struct intel_output *intel_output = to_intel_output(connector);
136 struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv; 137 struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
137 struct edid *edid = NULL; 138 struct edid *edid = NULL;
139 enum drm_connector_status status = connector_status_disconnected;
138 140
139 edid = drm_get_edid(&intel_output->base, 141 edid = drm_get_edid(&intel_output->base,
140 &intel_output->ddc_bus->adapter); 142 &intel_output->ddc_bus->adapter);
141 if (edid != NULL) { 143 hdmi_priv->has_hdmi_sink = false;
142 hdmi_priv->has_hdmi_sink = drm_detect_hdmi_monitor(edid); 144 if (edid) {
143 kfree(edid); 145 if (edid->digital) {
146 status = connector_status_connected;
147 hdmi_priv->has_hdmi_sink = drm_detect_hdmi_monitor(edid);
148 }
144 intel_output->base.display_info.raw_edid = NULL; 149 intel_output->base.display_info.raw_edid = NULL;
150 kfree(edid);
145 } 151 }
152 return status;
146} 153}
147 154
148static enum drm_connector_status 155static enum drm_connector_status
@@ -154,11 +161,7 @@ igdng_hdmi_detect(struct drm_connector *connector)
154 /* FIXME hotplug detect */ 161 /* FIXME hotplug detect */
155 162
156 hdmi_priv->has_hdmi_sink = false; 163 hdmi_priv->has_hdmi_sink = false;
157 intel_hdmi_sink_detect(connector); 164 return intel_hdmi_edid_detect(connector);
158 if (hdmi_priv->has_hdmi_sink)
159 return connector_status_connected;
160 else
161 return connector_status_disconnected;
162} 165}
163 166
164static enum drm_connector_status 167static enum drm_connector_status
@@ -201,10 +204,9 @@ intel_hdmi_detect(struct drm_connector *connector)
201 return connector_status_unknown; 204 return connector_status_unknown;
202 } 205 }
203 206
204 if ((I915_READ(PORT_HOTPLUG_STAT) & bit) != 0) { 207 if ((I915_READ(PORT_HOTPLUG_STAT) & bit) != 0)
205 intel_hdmi_sink_detect(connector); 208 return intel_hdmi_edid_detect(connector);
206 return connector_status_connected; 209 else
207 } else
208 return connector_status_disconnected; 210 return connector_status_disconnected;
209} 211}
210 212