diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2011-01-04 18:09:32 -0500 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-19 07:36:11 -0500 |
commit | ea0760cfc00b9e534423fdaf630d1c8ce7a5ede0 (patch) | |
tree | aab37bb880e9097251f112968e2d1e6d8a77963b /drivers/gpu/drm/i915/intel_display.c | |
parent | b24e71798871089da1a4ab049db2800afc1aac0c (diff) |
drm/i915: add panel lock assertion function
When PLLs or timing regs are changed, we need to make sure the panel
lock will allow it.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 2bf72a4b069f..491ac56199d1 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -1081,6 +1081,35 @@ static void assert_pll(struct drm_i915_private *dev_priv, | |||
1081 | #define assert_pll_enabled(d, p) assert_pll(d, p, true) | 1081 | #define assert_pll_enabled(d, p) assert_pll(d, p, true) |
1082 | #define assert_pll_disabled(d, p) assert_pll(d, p, false) | 1082 | #define assert_pll_disabled(d, p) assert_pll(d, p, false) |
1083 | 1083 | ||
1084 | static void assert_panel_unlocked(struct drm_i915_private *dev_priv, | ||
1085 | enum pipe pipe) | ||
1086 | { | ||
1087 | int pp_reg, lvds_reg; | ||
1088 | u32 val; | ||
1089 | enum pipe panel_pipe = PIPE_A; | ||
1090 | bool locked = locked; | ||
1091 | |||
1092 | if (HAS_PCH_SPLIT(dev_priv->dev)) { | ||
1093 | pp_reg = PCH_PP_CONTROL; | ||
1094 | lvds_reg = PCH_LVDS; | ||
1095 | } else { | ||
1096 | pp_reg = PP_CONTROL; | ||
1097 | lvds_reg = LVDS; | ||
1098 | } | ||
1099 | |||
1100 | val = I915_READ(pp_reg); | ||
1101 | if (!(val & PANEL_POWER_ON) || | ||
1102 | ((val & PANEL_UNLOCK_REGS) == PANEL_UNLOCK_REGS)) | ||
1103 | locked = false; | ||
1104 | |||
1105 | if (I915_READ(lvds_reg) & LVDS_PIPEB_SELECT) | ||
1106 | panel_pipe = PIPE_B; | ||
1107 | |||
1108 | WARN(panel_pipe == pipe && locked, | ||
1109 | "panel assertion failure, pipe %c regs locked\n", | ||
1110 | pipe ? 'B' : 'A'); | ||
1111 | } | ||
1112 | |||
1084 | static void assert_pipe_enabled(struct drm_i915_private *dev_priv, | 1113 | static void assert_pipe_enabled(struct drm_i915_private *dev_priv, |
1085 | enum pipe pipe) | 1114 | enum pipe pipe) |
1086 | { | 1115 | { |