aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2014-07-04 12:38:36 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-07-10 16:17:57 -0400
commit1f835a77ac6061f346da2ce3f2c377ab2b5693c3 (patch)
tree69d130b8bf1f39218af13a1b52e4c69916bfd5bd
parent34a6c70f099ef33e04e7436ee962293beead7b90 (diff)
drm/i915: don't read LVDS regs at compute_config time
We may reach this point while the machine is still runtime suspended, so we'll hit a WARN. The other encoders also don't touch registers at this point, so instead of waking the machine up, write some code to keep the register always at the same state, including after we runtime suspend/resume. Testcase: igt/pm_rpm Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80463 Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index cba04ddc8b01..a3126e0fd11e 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -51,6 +51,7 @@ struct intel_lvds_encoder {
51 51
52 bool is_dual_link; 52 bool is_dual_link;
53 u32 reg; 53 u32 reg;
54 u32 a3_power;
54 55
55 struct intel_lvds_connector *attached_connector; 56 struct intel_lvds_connector *attached_connector;
56}; 57};
@@ -170,8 +171,11 @@ static void intel_pre_enable_lvds(struct intel_encoder *encoder)
170 171
171 /* It would be nice to set 24 vs 18-bit mode (LVDS_A3_POWER_UP) 172 /* It would be nice to set 24 vs 18-bit mode (LVDS_A3_POWER_UP)
172 * appropriately here, but we need to look more thoroughly into how 173 * appropriately here, but we need to look more thoroughly into how
173 * panels behave in the two modes. 174 * panels behave in the two modes. For now, let's just maintain the
175 * value we got from the BIOS.
174 */ 176 */
177 temp &= ~LVDS_A3_POWER_MASK;
178 temp |= lvds_encoder->a3_power;
175 179
176 /* Set the dithering flag on LVDS as needed, note that there is no 180 /* Set the dithering flag on LVDS as needed, note that there is no
177 * special lvds dither control bit on pch-split platforms, dithering is 181 * special lvds dither control bit on pch-split platforms, dithering is
@@ -269,7 +273,6 @@ static bool intel_lvds_compute_config(struct intel_encoder *intel_encoder,
269 struct intel_crtc_config *pipe_config) 273 struct intel_crtc_config *pipe_config)
270{ 274{
271 struct drm_device *dev = intel_encoder->base.dev; 275 struct drm_device *dev = intel_encoder->base.dev;
272 struct drm_i915_private *dev_priv = dev->dev_private;
273 struct intel_lvds_encoder *lvds_encoder = 276 struct intel_lvds_encoder *lvds_encoder =
274 to_lvds_encoder(&intel_encoder->base); 277 to_lvds_encoder(&intel_encoder->base);
275 struct intel_connector *intel_connector = 278 struct intel_connector *intel_connector =
@@ -284,8 +287,7 @@ static bool intel_lvds_compute_config(struct intel_encoder *intel_encoder,
284 return false; 287 return false;
285 } 288 }
286 289
287 if ((I915_READ(lvds_encoder->reg) & LVDS_A3_POWER_MASK) == 290 if (lvds_encoder->a3_power == LVDS_A3_POWER_UP)
288 LVDS_A3_POWER_UP)
289 lvds_bpp = 8*3; 291 lvds_bpp = 8*3;
290 else 292 else
291 lvds_bpp = 6*3; 293 lvds_bpp = 6*3;
@@ -1086,6 +1088,9 @@ out:
1086 DRM_DEBUG_KMS("detected %s-link lvds configuration\n", 1088 DRM_DEBUG_KMS("detected %s-link lvds configuration\n",
1087 lvds_encoder->is_dual_link ? "dual" : "single"); 1089 lvds_encoder->is_dual_link ? "dual" : "single");
1088 1090
1091 lvds_encoder->a3_power = I915_READ(lvds_encoder->reg) &
1092 LVDS_A3_POWER_MASK;
1093
1089 /* 1094 /*
1090 * Unlock registers and just 1095 * Unlock registers and just
1091 * leave them unlocked 1096 * leave them unlocked