aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyuw@linux.intel.com>2009-06-05 03:38:43 -0400
committerEric Anholt <eric@anholt.net>2009-06-05 07:35:17 -0400
commit30ad48b7334a2eb2edf22f6c91f7b3f22a22a837 (patch)
tree01efd9f1172ca1c7820c7c4f0830e599e5da1ce7 /drivers
parent2c07245fb8f7f0a282282e5a9747e46defdb2cc7 (diff)
drm/i915: Add HDMI support on IGDNG
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c17
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c33
2 files changed, 47 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 2cd6ba6523d8..53cf6efa67b6 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2432,7 +2432,22 @@ static void intel_setup_outputs(struct drm_device *dev)
2432 intel_lvds_init(dev); 2432 intel_lvds_init(dev);
2433 2433
2434 if (IS_IGDNG(dev)) { 2434 if (IS_IGDNG(dev)) {
2435 /* ignore for other outputs */ 2435 int found;
2436
2437 if (I915_READ(HDMIB) & PORT_DETECTED) {
2438 /* check SDVOB */
2439 /* found = intel_sdvo_init(dev, HDMIB); */
2440 found = 0;
2441 if (!found)
2442 intel_hdmi_init(dev, HDMIB);
2443 }
2444
2445 if (I915_READ(HDMIC) & PORT_DETECTED)
2446 intel_hdmi_init(dev, HDMIC);
2447
2448 if (I915_READ(HDMID) & PORT_DETECTED)
2449 intel_hdmi_init(dev, HDMID);
2450
2436 } else if (IS_I9XX(dev)) { 2451 } else if (IS_I9XX(dev)) {
2437 int found; 2452 int found;
2438 u32 reg; 2453 u32 reg;
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index d0983bb93a18..d874b0c4b065 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -56,7 +56,8 @@ static void intel_hdmi_mode_set(struct drm_encoder *encoder,
56 sdvox = SDVO_ENCODING_HDMI | 56 sdvox = SDVO_ENCODING_HDMI |
57 SDVO_BORDER_ENABLE | 57 SDVO_BORDER_ENABLE |
58 SDVO_VSYNC_ACTIVE_HIGH | 58 SDVO_VSYNC_ACTIVE_HIGH |
59 SDVO_HSYNC_ACTIVE_HIGH; 59 SDVO_HSYNC_ACTIVE_HIGH |
60 SDVO_NULL_PACKETS_DURING_VSYNC;
60 61
61 if (hdmi_priv->has_hdmi_sink) 62 if (hdmi_priv->has_hdmi_sink)
62 sdvox |= SDVO_AUDIO_ENABLE; 63 sdvox |= SDVO_AUDIO_ENABLE;
@@ -145,6 +146,22 @@ intel_hdmi_sink_detect(struct drm_connector *connector)
145} 146}
146 147
147static enum drm_connector_status 148static enum drm_connector_status
149igdng_hdmi_detect(struct drm_connector *connector)
150{
151 struct intel_output *intel_output = to_intel_output(connector);
152 struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
153
154 /* FIXME hotplug detect */
155
156 hdmi_priv->has_hdmi_sink = false;
157 intel_hdmi_sink_detect(connector);
158 if (hdmi_priv->has_hdmi_sink)
159 return connector_status_connected;
160 else
161 return connector_status_disconnected;
162}
163
164static enum drm_connector_status
148intel_hdmi_detect(struct drm_connector *connector) 165intel_hdmi_detect(struct drm_connector *connector)
149{ 166{
150 struct drm_device *dev = connector->dev; 167 struct drm_device *dev = connector->dev;
@@ -153,6 +170,9 @@ intel_hdmi_detect(struct drm_connector *connector)
153 struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv; 170 struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
154 u32 temp, bit; 171 u32 temp, bit;
155 172
173 if (IS_IGDNG(dev))
174 return igdng_hdmi_detect(connector);
175
156 temp = I915_READ(PORT_HOTPLUG_EN); 176 temp = I915_READ(PORT_HOTPLUG_EN);
157 177
158 switch (hdmi_priv->sdvox_reg) { 178 switch (hdmi_priv->sdvox_reg) {
@@ -268,8 +288,17 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg)
268 /* Set up the DDC bus. */ 288 /* Set up the DDC bus. */
269 if (sdvox_reg == SDVOB) 289 if (sdvox_reg == SDVOB)
270 intel_output->ddc_bus = intel_i2c_create(dev, GPIOE, "HDMIB"); 290 intel_output->ddc_bus = intel_i2c_create(dev, GPIOE, "HDMIB");
271 else 291 else if (sdvox_reg == SDVOC)
272 intel_output->ddc_bus = intel_i2c_create(dev, GPIOD, "HDMIC"); 292 intel_output->ddc_bus = intel_i2c_create(dev, GPIOD, "HDMIC");
293 else if (sdvox_reg == HDMIB)
294 intel_output->ddc_bus = intel_i2c_create(dev, PCH_GPIOE,
295 "HDMIB");
296 else if (sdvox_reg == HDMIC)
297 intel_output->ddc_bus = intel_i2c_create(dev, PCH_GPIOD,
298 "HDMIC");
299 else if (sdvox_reg == HDMID)
300 intel_output->ddc_bus = intel_i2c_create(dev, PCH_GPIOF,
301 "HDMID");
273 302
274 if (!intel_output->ddc_bus) 303 if (!intel_output->ddc_bus)
275 goto err_connector; 304 goto err_connector;