diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lvds.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_lvds.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index b8af94a5be39..c3b4da7895ed 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -92,6 +92,7 @@ static void intel_lvds_get_config(struct intel_encoder *encoder, | |||
92 | struct drm_device *dev = encoder->base.dev; | 92 | struct drm_device *dev = encoder->base.dev; |
93 | struct drm_i915_private *dev_priv = dev->dev_private; | 93 | struct drm_i915_private *dev_priv = dev->dev_private; |
94 | u32 lvds_reg, tmp, flags = 0; | 94 | u32 lvds_reg, tmp, flags = 0; |
95 | int dotclock; | ||
95 | 96 | ||
96 | if (HAS_PCH_SPLIT(dev)) | 97 | if (HAS_PCH_SPLIT(dev)) |
97 | lvds_reg = PCH_LVDS; | 98 | lvds_reg = PCH_LVDS; |
@@ -116,6 +117,13 @@ static void intel_lvds_get_config(struct intel_encoder *encoder, | |||
116 | 117 | ||
117 | pipe_config->gmch_pfit.control |= tmp & PANEL_8TO6_DITHER_ENABLE; | 118 | pipe_config->gmch_pfit.control |= tmp & PANEL_8TO6_DITHER_ENABLE; |
118 | } | 119 | } |
120 | |||
121 | dotclock = pipe_config->port_clock; | ||
122 | |||
123 | if (HAS_PCH_SPLIT(dev_priv->dev)) | ||
124 | ironlake_check_encoder_dotclock(pipe_config, dotclock); | ||
125 | |||
126 | pipe_config->adjusted_mode.crtc_clock = dotclock; | ||
119 | } | 127 | } |
120 | 128 | ||
121 | /* The LVDS pin pair needs to be on before the DPLLs are enabled. | 129 | /* The LVDS pin pair needs to be on before the DPLLs are enabled. |
@@ -198,7 +206,8 @@ static void intel_enable_lvds(struct intel_encoder *encoder) | |||
198 | { | 206 | { |
199 | struct drm_device *dev = encoder->base.dev; | 207 | struct drm_device *dev = encoder->base.dev; |
200 | struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); | 208 | struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); |
201 | struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc); | 209 | struct intel_connector *intel_connector = |
210 | &lvds_encoder->attached_connector->base; | ||
202 | struct drm_i915_private *dev_priv = dev->dev_private; | 211 | struct drm_i915_private *dev_priv = dev->dev_private; |
203 | u32 ctl_reg, stat_reg; | 212 | u32 ctl_reg, stat_reg; |
204 | 213 | ||
@@ -217,13 +226,15 @@ static void intel_enable_lvds(struct intel_encoder *encoder) | |||
217 | if (wait_for((I915_READ(stat_reg) & PP_ON) != 0, 1000)) | 226 | if (wait_for((I915_READ(stat_reg) & PP_ON) != 0, 1000)) |
218 | DRM_ERROR("timed out waiting for panel to power on\n"); | 227 | DRM_ERROR("timed out waiting for panel to power on\n"); |
219 | 228 | ||
220 | intel_panel_enable_backlight(dev, intel_crtc->pipe); | 229 | intel_panel_enable_backlight(intel_connector); |
221 | } | 230 | } |
222 | 231 | ||
223 | static void intel_disable_lvds(struct intel_encoder *encoder) | 232 | static void intel_disable_lvds(struct intel_encoder *encoder) |
224 | { | 233 | { |
225 | struct drm_device *dev = encoder->base.dev; | 234 | struct drm_device *dev = encoder->base.dev; |
226 | struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); | 235 | struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); |
236 | struct intel_connector *intel_connector = | ||
237 | &lvds_encoder->attached_connector->base; | ||
227 | struct drm_i915_private *dev_priv = dev->dev_private; | 238 | struct drm_i915_private *dev_priv = dev->dev_private; |
228 | u32 ctl_reg, stat_reg; | 239 | u32 ctl_reg, stat_reg; |
229 | 240 | ||
@@ -235,7 +246,7 @@ static void intel_disable_lvds(struct intel_encoder *encoder) | |||
235 | stat_reg = PP_STATUS; | 246 | stat_reg = PP_STATUS; |
236 | } | 247 | } |
237 | 248 | ||
238 | intel_panel_disable_backlight(dev); | 249 | intel_panel_disable_backlight(intel_connector); |
239 | 250 | ||
240 | I915_WRITE(ctl_reg, I915_READ(ctl_reg) & ~POWER_TARGET_ON); | 251 | I915_WRITE(ctl_reg, I915_READ(ctl_reg) & ~POWER_TARGET_ON); |
241 | if (wait_for((I915_READ(stat_reg) & PP_ON) == 0, 1000)) | 252 | if (wait_for((I915_READ(stat_reg) & PP_ON) == 0, 1000)) |
@@ -466,7 +477,6 @@ static void intel_lvds_destroy(struct drm_connector *connector) | |||
466 | 477 | ||
467 | intel_panel_fini(&lvds_connector->base.panel); | 478 | intel_panel_fini(&lvds_connector->base.panel); |
468 | 479 | ||
469 | drm_sysfs_connector_remove(connector); | ||
470 | drm_connector_cleanup(connector); | 480 | drm_connector_cleanup(connector); |
471 | kfree(connector); | 481 | kfree(connector); |
472 | } | 482 | } |
@@ -802,7 +812,8 @@ static bool lvds_is_present_in_vbt(struct drm_device *dev, | |||
802 | return true; | 812 | return true; |
803 | 813 | ||
804 | for (i = 0; i < dev_priv->vbt.child_dev_num; i++) { | 814 | for (i = 0; i < dev_priv->vbt.child_dev_num; i++) { |
805 | struct child_device_config *child = dev_priv->vbt.child_dev + i; | 815 | union child_device_config *uchild = dev_priv->vbt.child_dev + i; |
816 | struct old_child_dev_config *child = &uchild->old; | ||
806 | 817 | ||
807 | /* If the device type is not LFP, continue. | 818 | /* If the device type is not LFP, continue. |
808 | * We have to check both the new identifiers as well as the | 819 | * We have to check both the new identifiers as well as the |
@@ -956,11 +967,11 @@ void intel_lvds_init(struct drm_device *dev) | |||
956 | } | 967 | } |
957 | } | 968 | } |
958 | 969 | ||
959 | lvds_encoder = kzalloc(sizeof(struct intel_lvds_encoder), GFP_KERNEL); | 970 | lvds_encoder = kzalloc(sizeof(*lvds_encoder), GFP_KERNEL); |
960 | if (!lvds_encoder) | 971 | if (!lvds_encoder) |
961 | return; | 972 | return; |
962 | 973 | ||
963 | lvds_connector = kzalloc(sizeof(struct intel_lvds_connector), GFP_KERNEL); | 974 | lvds_connector = kzalloc(sizeof(*lvds_connector), GFP_KERNEL); |
964 | if (!lvds_connector) { | 975 | if (!lvds_connector) { |
965 | kfree(lvds_encoder); | 976 | kfree(lvds_encoder); |
966 | return; | 977 | return; |