diff options
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_crt.c | 23 |
2 files changed, 17 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index d122c93643e6..81a3de6b093c 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -1552,6 +1552,7 @@ | |||
1552 | /* VGA port control */ | 1552 | /* VGA port control */ |
1553 | #define ADPA 0x61100 | 1553 | #define ADPA 0x61100 |
1554 | #define PCH_ADPA 0xe1100 | 1554 | #define PCH_ADPA 0xe1100 |
1555 | #define VLV_ADPA (VLV_DISPLAY_BASE + ADPA) | ||
1555 | 1556 | ||
1556 | #define ADPA_DAC_ENABLE (1<<31) | 1557 | #define ADPA_DAC_ENABLE (1<<31) |
1557 | #define ADPA_DAC_DISABLE 0 | 1558 | #define ADPA_DAC_DISABLE 0 |
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index e1d02be368a5..bc5e2c97db61 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -47,6 +47,7 @@ | |||
47 | struct intel_crt { | 47 | struct intel_crt { |
48 | struct intel_encoder base; | 48 | struct intel_encoder base; |
49 | bool force_hotplug_required; | 49 | bool force_hotplug_required; |
50 | u32 adpa_reg; | ||
50 | }; | 51 | }; |
51 | 52 | ||
52 | static struct intel_crt *intel_attached_crt(struct drm_connector *connector) | 53 | static struct intel_crt *intel_attached_crt(struct drm_connector *connector) |
@@ -55,6 +56,11 @@ static struct intel_crt *intel_attached_crt(struct drm_connector *connector) | |||
55 | struct intel_crt, base); | 56 | struct intel_crt, base); |
56 | } | 57 | } |
57 | 58 | ||
59 | static struct intel_crt *intel_encoder_to_crt(struct intel_encoder *encoder) | ||
60 | { | ||
61 | return container_of(encoder, struct intel_crt, base); | ||
62 | } | ||
63 | |||
58 | static void pch_crt_dpms(struct drm_encoder *encoder, int mode) | 64 | static void pch_crt_dpms(struct drm_encoder *encoder, int mode) |
59 | { | 65 | { |
60 | struct drm_device *dev = encoder->dev; | 66 | struct drm_device *dev = encoder->dev; |
@@ -145,19 +151,15 @@ static void intel_crt_mode_set(struct drm_encoder *encoder, | |||
145 | 151 | ||
146 | struct drm_device *dev = encoder->dev; | 152 | struct drm_device *dev = encoder->dev; |
147 | struct drm_crtc *crtc = encoder->crtc; | 153 | struct drm_crtc *crtc = encoder->crtc; |
154 | struct intel_crt *crt = | ||
155 | intel_encoder_to_crt(to_intel_encoder(encoder)); | ||
148 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 156 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
149 | struct drm_i915_private *dev_priv = dev->dev_private; | 157 | struct drm_i915_private *dev_priv = dev->dev_private; |
150 | int dpll_md_reg; | 158 | int dpll_md_reg; |
151 | u32 adpa, dpll_md; | 159 | u32 adpa, dpll_md; |
152 | u32 adpa_reg; | ||
153 | 160 | ||
154 | dpll_md_reg = DPLL_MD(intel_crtc->pipe); | 161 | dpll_md_reg = DPLL_MD(intel_crtc->pipe); |
155 | 162 | ||
156 | if (HAS_PCH_SPLIT(dev)) | ||
157 | adpa_reg = PCH_ADPA; | ||
158 | else | ||
159 | adpa_reg = ADPA; | ||
160 | |||
161 | /* | 163 | /* |
162 | * Disable separate mode multiplier used when cloning SDVO to CRT | 164 | * Disable separate mode multiplier used when cloning SDVO to CRT |
163 | * XXX this needs to be adjusted when we really are cloning | 165 | * XXX this needs to be adjusted when we really are cloning |
@@ -185,7 +187,7 @@ static void intel_crt_mode_set(struct drm_encoder *encoder, | |||
185 | if (!HAS_PCH_SPLIT(dev)) | 187 | if (!HAS_PCH_SPLIT(dev)) |
186 | I915_WRITE(BCLRPAT(intel_crtc->pipe), 0); | 188 | I915_WRITE(BCLRPAT(intel_crtc->pipe), 0); |
187 | 189 | ||
188 | I915_WRITE(adpa_reg, adpa); | 190 | I915_WRITE(crt->adpa_reg, adpa); |
189 | } | 191 | } |
190 | 192 | ||
191 | static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector) | 193 | static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector) |
@@ -675,6 +677,13 @@ void intel_crt_init(struct drm_device *dev) | |||
675 | else | 677 | else |
676 | encoder_helper_funcs = &gmch_encoder_funcs; | 678 | encoder_helper_funcs = &gmch_encoder_funcs; |
677 | 679 | ||
680 | if (HAS_PCH_SPLIT(dev)) | ||
681 | crt->adpa_reg = PCH_ADPA; | ||
682 | else if (IS_VALLEYVIEW(dev)) | ||
683 | crt->adpa_reg = VLV_ADPA; | ||
684 | else | ||
685 | crt->adpa_reg = ADPA; | ||
686 | |||
678 | drm_encoder_helper_add(&crt->base.base, encoder_helper_funcs); | 687 | drm_encoder_helper_add(&crt->base.base, encoder_helper_funcs); |
679 | drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs); | 688 | drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs); |
680 | 689 | ||