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, 18 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index d6a1a6e5539a..590f81c8f594 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -156,6 +156,9 @@ static bool intel_igdng_crt_detect_hotplug(struct drm_connector *connector) | |||
156 | 156 | ||
157 | temp = adpa = I915_READ(PCH_ADPA); | 157 | temp = adpa = I915_READ(PCH_ADPA); |
158 | 158 | ||
159 | adpa &= ~ADPA_DAC_ENABLE; | ||
160 | I915_WRITE(PCH_ADPA, adpa); | ||
161 | |||
159 | adpa &= ~ADPA_CRT_HOTPLUG_MASK; | 162 | adpa &= ~ADPA_CRT_HOTPLUG_MASK; |
160 | 163 | ||
161 | adpa |= (ADPA_CRT_HOTPLUG_PERIOD_128 | | 164 | adpa |= (ADPA_CRT_HOTPLUG_PERIOD_128 | |
@@ -169,13 +172,14 @@ static bool intel_igdng_crt_detect_hotplug(struct drm_connector *connector) | |||
169 | DRM_DEBUG("pch crt adpa 0x%x", adpa); | 172 | DRM_DEBUG("pch crt adpa 0x%x", adpa); |
170 | I915_WRITE(PCH_ADPA, adpa); | 173 | I915_WRITE(PCH_ADPA, adpa); |
171 | 174 | ||
172 | /* This might not be needed as not specified in spec...*/ | 175 | while ((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) != 0) |
173 | udelay(1000); | 176 | ; |
174 | 177 | ||
175 | /* Check the status to see if both blue and green are on now */ | 178 | /* Check the status to see if both blue and green are on now */ |
176 | adpa = I915_READ(PCH_ADPA); | 179 | adpa = I915_READ(PCH_ADPA); |
177 | if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) == | 180 | adpa &= ADPA_CRT_HOTPLUG_MONITOR_MASK; |
178 | ADPA_CRT_HOTPLUG_MONITOR_COLOR) | 181 | if ((adpa == ADPA_CRT_HOTPLUG_MONITOR_COLOR) || |
182 | (adpa == ADPA_CRT_HOTPLUG_MONITOR_MONO)) | ||
179 | ret = true; | 183 | ret = true; |
180 | else | 184 | else |
181 | ret = false; | 185 | ret = false; |
@@ -504,6 +508,7 @@ void intel_crt_init(struct drm_device *dev) | |||
504 | { | 508 | { |
505 | struct drm_connector *connector; | 509 | struct drm_connector *connector; |
506 | struct intel_output *intel_output; | 510 | struct intel_output *intel_output; |
511 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
507 | u32 i2c_reg; | 512 | u32 i2c_reg; |
508 | 513 | ||
509 | intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL); | 514 | intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL); |
@@ -523,8 +528,12 @@ void intel_crt_init(struct drm_device *dev) | |||
523 | /* Set up the DDC bus. */ | 528 | /* Set up the DDC bus. */ |
524 | if (IS_IGDNG(dev)) | 529 | if (IS_IGDNG(dev)) |
525 | i2c_reg = PCH_GPIOA; | 530 | i2c_reg = PCH_GPIOA; |
526 | else | 531 | else { |
527 | i2c_reg = GPIOA; | 532 | i2c_reg = GPIOA; |
533 | /* Use VBT information for CRT DDC if available */ | ||
534 | if (dev_priv->crt_ddc_bus != -1) | ||
535 | i2c_reg = dev_priv->crt_ddc_bus; | ||
536 | } | ||
528 | intel_output->ddc_bus = intel_i2c_create(dev, i2c_reg, "CRTDDC_A"); | 537 | intel_output->ddc_bus = intel_i2c_create(dev, i2c_reg, "CRTDDC_A"); |
529 | if (!intel_output->ddc_bus) { | 538 | if (!intel_output->ddc_bus) { |
530 | dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration " | 539 | dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration " |
@@ -533,6 +542,10 @@ void intel_crt_init(struct drm_device *dev) | |||
533 | } | 542 | } |
534 | 543 | ||
535 | intel_output->type = INTEL_OUTPUT_ANALOG; | 544 | intel_output->type = INTEL_OUTPUT_ANALOG; |
545 | intel_output->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) | | ||
546 | (1 << INTEL_ANALOG_CLONE_BIT) | | ||
547 | (1 << INTEL_SDVO_LVDS_CLONE_BIT); | ||
548 | intel_output->crtc_mask = (1 << 0) | (1 << 1); | ||
536 | connector->interlace_allowed = 0; | 549 | connector->interlace_allowed = 0; |
537 | connector->doublescan_allowed = 0; | 550 | connector->doublescan_allowed = 0; |
538 | 551 | ||