Commit bedd4dba authored by Jani Nikula's avatar Jani Nikula Committed by Daniel Vetter

drm/i915: improve assert_panel_unlocked

Fix assert_panel_unlocked for vlv/chv, and improve it a bit for
non-LVDS. Also don't pretend it works for DDI. There's still work to do
to get this right for eDP on PCH platforms, but this is a start.

v2: WARN_ON(HAS_DDI)
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent ac66cf4b
...@@ -1195,17 +1195,33 @@ void assert_fdi_rx_pll(struct drm_i915_private *dev_priv, ...@@ -1195,17 +1195,33 @@ void assert_fdi_rx_pll(struct drm_i915_private *dev_priv,
static void assert_panel_unlocked(struct drm_i915_private *dev_priv, static void assert_panel_unlocked(struct drm_i915_private *dev_priv,
enum pipe pipe) enum pipe pipe)
{ {
int pp_reg, lvds_reg; struct drm_device *dev = dev_priv->dev;
int pp_reg;
u32 val; u32 val;
enum pipe panel_pipe = PIPE_A; enum pipe panel_pipe = PIPE_A;
bool locked = true; bool locked = true;
if (HAS_PCH_SPLIT(dev_priv->dev)) { if (WARN_ON(HAS_DDI(dev)))
return;
if (HAS_PCH_SPLIT(dev)) {
u32 port_sel;
pp_reg = PCH_PP_CONTROL; pp_reg = PCH_PP_CONTROL;
lvds_reg = PCH_LVDS; port_sel = I915_READ(PCH_PP_ON_DELAYS) & PANEL_PORT_SELECT_MASK;
if (port_sel == PANEL_PORT_SELECT_LVDS &&
I915_READ(PCH_LVDS) & LVDS_PIPEB_SELECT)
panel_pipe = PIPE_B;
/* XXX: else fix for eDP */
} else if (IS_VALLEYVIEW(dev)) {
/* presumably write lock depends on pipe, not port select */
pp_reg = VLV_PIPE_PP_CONTROL(pipe);
panel_pipe = pipe;
} else { } else {
pp_reg = PP_CONTROL; pp_reg = PP_CONTROL;
lvds_reg = LVDS; if (I915_READ(LVDS) & LVDS_PIPEB_SELECT)
panel_pipe = PIPE_B;
} }
val = I915_READ(pp_reg); val = I915_READ(pp_reg);
...@@ -1213,9 +1229,6 @@ static void assert_panel_unlocked(struct drm_i915_private *dev_priv, ...@@ -1213,9 +1229,6 @@ static void assert_panel_unlocked(struct drm_i915_private *dev_priv,
((val & PANEL_UNLOCK_MASK) == PANEL_UNLOCK_REGS)) ((val & PANEL_UNLOCK_MASK) == PANEL_UNLOCK_REGS))
locked = false; locked = false;
if (I915_READ(lvds_reg) & LVDS_PIPEB_SELECT)
panel_pipe = PIPE_B;
WARN(panel_pipe == pipe && locked, WARN(panel_pipe == pipe && locked,
"panel assertion failure, pipe %c regs locked\n", "panel assertion failure, pipe %c regs locked\n",
pipe_name(pipe)); pipe_name(pipe));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment