diff options
author | Dave Airlie <airlied@redhat.com> | 2009-09-07 06:27:20 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-09-07 06:27:20 -0400 |
commit | 11670d3c93210793562748d83502ecbef4034765 (patch) | |
tree | 9e2c33c6249e26b05a2b5db87d4f4840e9049840 /drivers/gpu/drm/i915/intel_crt.c | |
parent | 575dc34ee0de867ba83abf25998e0963bff451fa (diff) | |
parent | 01dfba93d9dfcf6d7abfc55ff5d9d6e76fa01ba0 (diff) |
Merge intel drm-intel-next branch
Merge remote branch 'anholt/drm-intel-next' of ../anholt-2.6 into drm-next
Conflicts:
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_sdvo.c
Diffstat (limited to 'drivers/gpu/drm/i915/intel_crt.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_crt.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index 4cf8e2e88a40..88814fa2dfd2 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -64,6 +64,34 @@ static void intel_crt_dpms(struct drm_encoder *encoder, int mode) | |||
64 | } | 64 | } |
65 | 65 | ||
66 | I915_WRITE(reg, temp); | 66 | I915_WRITE(reg, temp); |
67 | |||
68 | if (IS_IGD(dev)) { | ||
69 | if (mode == DRM_MODE_DPMS_OFF) { | ||
70 | /* turn off DAC */ | ||
71 | temp = I915_READ(PORT_HOTPLUG_EN); | ||
72 | temp &= ~CRT_EOS_INT_EN; | ||
73 | I915_WRITE(PORT_HOTPLUG_EN, temp); | ||
74 | |||
75 | temp = I915_READ(PORT_HOTPLUG_STAT); | ||
76 | if (temp & CRT_EOS_INT_STATUS) | ||
77 | I915_WRITE(PORT_HOTPLUG_STAT, | ||
78 | CRT_EOS_INT_STATUS); | ||
79 | } else { | ||
80 | /* turn on DAC. EOS interrupt must be enabled after DAC | ||
81 | * is enabled, so it sounds not good to enable it in | ||
82 | * i915_driver_irq_postinstall() | ||
83 | * wait 12.5ms after DAC is enabled | ||
84 | */ | ||
85 | msleep(13); | ||
86 | temp = I915_READ(PORT_HOTPLUG_STAT); | ||
87 | if (temp & CRT_EOS_INT_STATUS) | ||
88 | I915_WRITE(PORT_HOTPLUG_STAT, | ||
89 | CRT_EOS_INT_STATUS); | ||
90 | temp = I915_READ(PORT_HOTPLUG_EN); | ||
91 | temp |= CRT_EOS_INT_EN; | ||
92 | I915_WRITE(PORT_HOTPLUG_EN, temp); | ||
93 | } | ||
94 | } | ||
67 | } | 95 | } |
68 | 96 | ||
69 | static int intel_crt_mode_valid(struct drm_connector *connector, | 97 | static int intel_crt_mode_valid(struct drm_connector *connector, |
@@ -508,6 +536,7 @@ void intel_crt_init(struct drm_device *dev) | |||
508 | { | 536 | { |
509 | struct drm_connector *connector; | 537 | struct drm_connector *connector; |
510 | struct intel_output *intel_output; | 538 | struct intel_output *intel_output; |
539 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
511 | u32 i2c_reg; | 540 | u32 i2c_reg; |
512 | 541 | ||
513 | intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL); | 542 | intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL); |
@@ -527,8 +556,12 @@ void intel_crt_init(struct drm_device *dev) | |||
527 | /* Set up the DDC bus. */ | 556 | /* Set up the DDC bus. */ |
528 | if (IS_IGDNG(dev)) | 557 | if (IS_IGDNG(dev)) |
529 | i2c_reg = PCH_GPIOA; | 558 | i2c_reg = PCH_GPIOA; |
530 | else | 559 | else { |
531 | i2c_reg = GPIOA; | 560 | i2c_reg = GPIOA; |
561 | /* Use VBT information for CRT DDC if available */ | ||
562 | if (dev_priv->crt_ddc_bus != -1) | ||
563 | i2c_reg = dev_priv->crt_ddc_bus; | ||
564 | } | ||
532 | intel_output->ddc_bus = intel_i2c_create(dev, i2c_reg, "CRTDDC_A"); | 565 | intel_output->ddc_bus = intel_i2c_create(dev, i2c_reg, "CRTDDC_A"); |
533 | if (!intel_output->ddc_bus) { | 566 | if (!intel_output->ddc_bus) { |
534 | dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration " | 567 | dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration " |
@@ -537,6 +570,10 @@ void intel_crt_init(struct drm_device *dev) | |||
537 | } | 570 | } |
538 | 571 | ||
539 | intel_output->type = INTEL_OUTPUT_ANALOG; | 572 | intel_output->type = INTEL_OUTPUT_ANALOG; |
573 | intel_output->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) | | ||
574 | (1 << INTEL_ANALOG_CLONE_BIT) | | ||
575 | (1 << INTEL_SDVO_LVDS_CLONE_BIT); | ||
576 | intel_output->crtc_mask = (1 << 0) | (1 << 1); | ||
540 | connector->interlace_allowed = 0; | 577 | connector->interlace_allowed = 0; |
541 | connector->doublescan_allowed = 0; | 578 | connector->doublescan_allowed = 0; |
542 | 579 | ||