aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-08 06:25:42 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-11-04 10:30:33 -0500
commit48f34e10169dbb3dd7a19af64e328492b7f54af4 (patch)
tree4a40d04d79fd7ff176b248818e4c977917d0abdd
parent7f16e5c1416070dc590dd333a2d677700046a4ab (diff)
drm/i915/dvo: call ->mode_set callback only when the port is running
The ns2501 controller seems to need the dpll and dvo port to accept the timing update commands. Quick testing on my x30 here seems to indicate that other dvo controllers don't mind. So let's move the ->mode_set callback to a place where we have the port up and running already. Tested-by: Chris Wilson <chris@chris-wilson.co.uk> Tested-by: Thomas Richter <thor@math.tu-berlin.de> Cc: stable@vger.kernel.org Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_dvo.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
index 1b64145c669a..3c7736546856 100644
--- a/drivers/gpu/drm/i915/intel_dvo.c
+++ b/drivers/gpu/drm/i915/intel_dvo.c
@@ -173,11 +173,16 @@ static void intel_enable_dvo(struct intel_encoder *encoder)
173{ 173{
174 struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; 174 struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
175 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);
176 u32 dvo_reg = intel_dvo->dev.dvo_reg; 177 u32 dvo_reg = intel_dvo->dev.dvo_reg;
177 u32 temp = I915_READ(dvo_reg); 178 u32 temp = I915_READ(dvo_reg);
178 179
179 I915_WRITE(dvo_reg, temp | DVO_ENABLE); 180 I915_WRITE(dvo_reg, temp | DVO_ENABLE);
180 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
181 intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true); 186 intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true);
182} 187}
183 188
@@ -186,6 +191,7 @@ static void intel_dvo_dpms(struct drm_connector *connector, int mode)
186{ 191{
187 struct intel_dvo *intel_dvo = intel_attached_dvo(connector); 192 struct intel_dvo *intel_dvo = intel_attached_dvo(connector);
188 struct drm_crtc *crtc; 193 struct drm_crtc *crtc;
194 struct intel_crtc_config *config;
189 195
190 /* dvo supports only 2 dpms states. */ 196 /* dvo supports only 2 dpms states. */
191 if (mode != DRM_MODE_DPMS_ON) 197 if (mode != DRM_MODE_DPMS_ON)
@@ -206,10 +212,16 @@ static void intel_dvo_dpms(struct drm_connector *connector, int mode)
206 /* 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
207 * change due to cloning. */ 213 * change due to cloning. */
208 if (mode == DRM_MODE_DPMS_ON) { 214 if (mode == DRM_MODE_DPMS_ON) {
215 config = &to_intel_crtc(crtc)->config;
216
209 intel_dvo->base.connectors_active = true; 217 intel_dvo->base.connectors_active = true;
210 218
211 intel_crtc_update_dpms(crtc); 219 intel_crtc_update_dpms(crtc);
212 220
221 intel_dvo->dev.dev_ops->mode_set(&intel_dvo->dev,
222 &config->requested_mode,
223 &config->adjusted_mode);
224
213 intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true); 225 intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true);
214 } else { 226 } else {
215 intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, false); 227 intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, false);
@@ -296,10 +308,6 @@ static void intel_dvo_mode_set(struct intel_encoder *encoder)
296 break; 308 break;
297 } 309 }
298 310
299 intel_dvo->dev.dev_ops->mode_set(&intel_dvo->dev,
300 &crtc->config.requested_mode,
301 adjusted_mode);
302
303 /* 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. */
304 dvo_val = I915_READ(dvo_reg) & 312 dvo_val = I915_READ(dvo_reg) &
305 (DVO_PRESERVE_MASK | DVO_DATA_ORDER_GBRG); 313 (DVO_PRESERVE_MASK | DVO_DATA_ORDER_GBRG);