diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dvo.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_dvo.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c index 7fa7df546c1e..3c7736546856 100644 --- a/drivers/gpu/drm/i915/intel_dvo.c +++ b/drivers/gpu/drm/i915/intel_dvo.c | |||
@@ -153,6 +153,8 @@ static void intel_dvo_get_config(struct intel_encoder *encoder, | |||
153 | flags |= DRM_MODE_FLAG_NVSYNC; | 153 | flags |= DRM_MODE_FLAG_NVSYNC; |
154 | 154 | ||
155 | pipe_config->adjusted_mode.flags |= flags; | 155 | pipe_config->adjusted_mode.flags |= flags; |
156 | |||
157 | pipe_config->adjusted_mode.crtc_clock = pipe_config->port_clock; | ||
156 | } | 158 | } |
157 | 159 | ||
158 | static void intel_disable_dvo(struct intel_encoder *encoder) | 160 | static void intel_disable_dvo(struct intel_encoder *encoder) |
@@ -171,11 +173,16 @@ static void intel_enable_dvo(struct intel_encoder *encoder) | |||
171 | { | 173 | { |
172 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; | 174 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; |
173 | struct intel_dvo *intel_dvo = enc_to_dvo(encoder); | 175 | struct intel_dvo *intel_dvo = enc_to_dvo(encoder); |
176 | struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc); | ||
174 | u32 dvo_reg = intel_dvo->dev.dvo_reg; | 177 | u32 dvo_reg = intel_dvo->dev.dvo_reg; |
175 | u32 temp = I915_READ(dvo_reg); | 178 | u32 temp = I915_READ(dvo_reg); |
176 | 179 | ||
177 | I915_WRITE(dvo_reg, temp | DVO_ENABLE); | 180 | I915_WRITE(dvo_reg, temp | DVO_ENABLE); |
178 | I915_READ(dvo_reg); | 181 | I915_READ(dvo_reg); |
182 | intel_dvo->dev.dev_ops->mode_set(&intel_dvo->dev, | ||
183 | &crtc->config.requested_mode, | ||
184 | &crtc->config.adjusted_mode); | ||
185 | |||
179 | intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true); | 186 | intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true); |
180 | } | 187 | } |
181 | 188 | ||
@@ -184,6 +191,7 @@ static void intel_dvo_dpms(struct drm_connector *connector, int mode) | |||
184 | { | 191 | { |
185 | struct intel_dvo *intel_dvo = intel_attached_dvo(connector); | 192 | struct intel_dvo *intel_dvo = intel_attached_dvo(connector); |
186 | struct drm_crtc *crtc; | 193 | struct drm_crtc *crtc; |
194 | struct intel_crtc_config *config; | ||
187 | 195 | ||
188 | /* dvo supports only 2 dpms states. */ | 196 | /* dvo supports only 2 dpms states. */ |
189 | if (mode != DRM_MODE_DPMS_ON) | 197 | if (mode != DRM_MODE_DPMS_ON) |
@@ -204,10 +212,16 @@ static void intel_dvo_dpms(struct drm_connector *connector, int mode) | |||
204 | /* We call connector dpms manually below in case pipe dpms doesn't | 212 | /* We call connector dpms manually below in case pipe dpms doesn't |
205 | * change due to cloning. */ | 213 | * change due to cloning. */ |
206 | if (mode == DRM_MODE_DPMS_ON) { | 214 | if (mode == DRM_MODE_DPMS_ON) { |
215 | config = &to_intel_crtc(crtc)->config; | ||
216 | |||
207 | intel_dvo->base.connectors_active = true; | 217 | intel_dvo->base.connectors_active = true; |
208 | 218 | ||
209 | intel_crtc_update_dpms(crtc); | 219 | intel_crtc_update_dpms(crtc); |
210 | 220 | ||
221 | intel_dvo->dev.dev_ops->mode_set(&intel_dvo->dev, | ||
222 | &config->requested_mode, | ||
223 | &config->adjusted_mode); | ||
224 | |||
211 | intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true); | 225 | intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true); |
212 | } else { | 226 | } else { |
213 | intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, false); | 227 | intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, false); |
@@ -267,11 +281,6 @@ static bool intel_dvo_compute_config(struct intel_encoder *encoder, | |||
267 | drm_mode_set_crtcinfo(adjusted_mode, 0); | 281 | drm_mode_set_crtcinfo(adjusted_mode, 0); |
268 | } | 282 | } |
269 | 283 | ||
270 | if (intel_dvo->dev.dev_ops->mode_fixup) | ||
271 | return intel_dvo->dev.dev_ops->mode_fixup(&intel_dvo->dev, | ||
272 | &pipe_config->requested_mode, | ||
273 | adjusted_mode); | ||
274 | |||
275 | return true; | 284 | return true; |
276 | } | 285 | } |
277 | 286 | ||
@@ -299,10 +308,6 @@ static void intel_dvo_mode_set(struct intel_encoder *encoder) | |||
299 | break; | 308 | break; |
300 | } | 309 | } |
301 | 310 | ||
302 | intel_dvo->dev.dev_ops->mode_set(&intel_dvo->dev, | ||
303 | &crtc->config.requested_mode, | ||
304 | adjusted_mode); | ||
305 | |||
306 | /* Save the data order, since I don't know what it should be set to. */ | 311 | /* Save the data order, since I don't know what it should be set to. */ |
307 | dvo_val = I915_READ(dvo_reg) & | 312 | dvo_val = I915_READ(dvo_reg) & |
308 | (DVO_PRESERVE_MASK | DVO_DATA_ORDER_GBRG); | 313 | (DVO_PRESERVE_MASK | DVO_DATA_ORDER_GBRG); |
@@ -370,7 +375,6 @@ static int intel_dvo_get_modes(struct drm_connector *connector) | |||
370 | 375 | ||
371 | static void intel_dvo_destroy(struct drm_connector *connector) | 376 | static void intel_dvo_destroy(struct drm_connector *connector) |
372 | { | 377 | { |
373 | drm_sysfs_connector_remove(connector); | ||
374 | drm_connector_cleanup(connector); | 378 | drm_connector_cleanup(connector); |
375 | kfree(connector); | 379 | kfree(connector); |
376 | } | 380 | } |
@@ -451,11 +455,11 @@ void intel_dvo_init(struct drm_device *dev) | |||
451 | int i; | 455 | int i; |
452 | int encoder_type = DRM_MODE_ENCODER_NONE; | 456 | int encoder_type = DRM_MODE_ENCODER_NONE; |
453 | 457 | ||
454 | intel_dvo = kzalloc(sizeof(struct intel_dvo), GFP_KERNEL); | 458 | intel_dvo = kzalloc(sizeof(*intel_dvo), GFP_KERNEL); |
455 | if (!intel_dvo) | 459 | if (!intel_dvo) |
456 | return; | 460 | return; |
457 | 461 | ||
458 | intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); | 462 | intel_connector = kzalloc(sizeof(*intel_connector), GFP_KERNEL); |
459 | if (!intel_connector) { | 463 | if (!intel_connector) { |
460 | kfree(intel_dvo); | 464 | kfree(intel_dvo); |
461 | return; | 465 | return; |