diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_crt.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_crt.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index e16ac5a28c3c..22ff38455731 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -217,7 +217,8 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector) | |||
217 | { | 217 | { |
218 | struct drm_device *dev = connector->dev; | 218 | struct drm_device *dev = connector->dev; |
219 | struct drm_i915_private *dev_priv = dev->dev_private; | 219 | struct drm_i915_private *dev_priv = dev->dev_private; |
220 | u32 hotplug_en; | 220 | u32 hotplug_en, orig, stat; |
221 | bool ret = false; | ||
221 | int i, tries = 0; | 222 | int i, tries = 0; |
222 | 223 | ||
223 | if (HAS_PCH_SPLIT(dev)) | 224 | if (HAS_PCH_SPLIT(dev)) |
@@ -232,8 +233,8 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector) | |||
232 | tries = 2; | 233 | tries = 2; |
233 | else | 234 | else |
234 | tries = 1; | 235 | tries = 1; |
235 | hotplug_en = I915_READ(PORT_HOTPLUG_EN); | 236 | hotplug_en = orig = I915_READ(PORT_HOTPLUG_EN); |
236 | hotplug_en &= CRT_FORCE_HOTPLUG_MASK; | 237 | hotplug_en &= CRT_HOTPLUG_MASK; |
237 | hotplug_en |= CRT_HOTPLUG_FORCE_DETECT; | 238 | hotplug_en |= CRT_HOTPLUG_FORCE_DETECT; |
238 | 239 | ||
239 | if (IS_G4X(dev)) | 240 | if (IS_G4X(dev)) |
@@ -255,11 +256,17 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector) | |||
255 | } while (time_after(timeout, jiffies)); | 256 | } while (time_after(timeout, jiffies)); |
256 | } | 257 | } |
257 | 258 | ||
258 | if ((I915_READ(PORT_HOTPLUG_STAT) & CRT_HOTPLUG_MONITOR_MASK) != | 259 | stat = I915_READ(PORT_HOTPLUG_STAT); |
259 | CRT_HOTPLUG_MONITOR_NONE) | 260 | if ((stat & CRT_HOTPLUG_MONITOR_MASK) != CRT_HOTPLUG_MONITOR_NONE) |
260 | return true; | 261 | ret = true; |
262 | |||
263 | /* clear the interrupt we just generated, if any */ | ||
264 | I915_WRITE(PORT_HOTPLUG_STAT, CRT_HOTPLUG_INT_STATUS); | ||
261 | 265 | ||
262 | return false; | 266 | /* and put the bits back */ |
267 | I915_WRITE(PORT_HOTPLUG_EN, orig); | ||
268 | |||
269 | return ret; | ||
263 | } | 270 | } |
264 | 271 | ||
265 | static bool intel_crt_detect_ddc(struct drm_encoder *encoder) | 272 | static bool intel_crt_detect_ddc(struct drm_encoder *encoder) |
@@ -569,7 +576,7 @@ void intel_crt_init(struct drm_device *dev) | |||
569 | (1 << INTEL_ANALOG_CLONE_BIT) | | 576 | (1 << INTEL_ANALOG_CLONE_BIT) | |
570 | (1 << INTEL_SDVO_LVDS_CLONE_BIT); | 577 | (1 << INTEL_SDVO_LVDS_CLONE_BIT); |
571 | intel_encoder->crtc_mask = (1 << 0) | (1 << 1); | 578 | intel_encoder->crtc_mask = (1 << 0) | (1 << 1); |
572 | connector->interlace_allowed = 0; | 579 | connector->interlace_allowed = 1; |
573 | connector->doublescan_allowed = 0; | 580 | connector->doublescan_allowed = 0; |
574 | 581 | ||
575 | drm_encoder_helper_add(&intel_encoder->enc, &intel_crt_helper_funcs); | 582 | drm_encoder_helper_add(&intel_encoder->enc, &intel_crt_helper_funcs); |