提交 48da64a8 编写于 作者: C Chris Wilson 提交者: Daniel Vetter

drm/i915: Convert BUG_ON(!pll->active) and friends to a WARN

Turn a fatal lockup into a merely blank display with lots of shouty
messages.

v2: Whilst in the area, convert the other BUG_ON into less fatal errors.
In particular, note that we may be called on a PCH platform not using
PLLs, such as Haswell, and so we do not always want to BUG_ON(!pll)
Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 a9dcf84b
...@@ -1403,14 +1403,18 @@ intel_sbi_read(struct drm_i915_private *dev_priv, u16 reg) ...@@ -1403,14 +1403,18 @@ intel_sbi_read(struct drm_i915_private *dev_priv, u16 reg)
static void intel_enable_pch_pll(struct intel_crtc *intel_crtc) static void intel_enable_pch_pll(struct intel_crtc *intel_crtc)
{ {
struct drm_i915_private *dev_priv = intel_crtc->base.dev->dev_private; struct drm_i915_private *dev_priv = intel_crtc->base.dev->dev_private;
struct intel_pch_pll *pll = intel_crtc->pch_pll; struct intel_pch_pll *pll;
int reg; int reg;
u32 val; u32 val;
/* PCH only available on ILK+ */ /* PCH PLLs only available on ILK, SNB and IVB */
BUG_ON(dev_priv->info->gen < 5); BUG_ON(dev_priv->info->gen < 5);
BUG_ON(pll == NULL); pll = intel_crtc->pch_pll;
BUG_ON(pll->refcount == 0); if (pll == NULL)
return;
if (WARN_ON(pll->refcount == 0))
return;
DRM_DEBUG_KMS("enable PCH PLL %x (active %d, on? %d)for crtc %d\n", DRM_DEBUG_KMS("enable PCH PLL %x (active %d, on? %d)for crtc %d\n",
pll->pll_reg, pll->active, pll->on, pll->pll_reg, pll->active, pll->on,
...@@ -1448,13 +1452,18 @@ static void intel_disable_pch_pll(struct intel_crtc *intel_crtc) ...@@ -1448,13 +1452,18 @@ static void intel_disable_pch_pll(struct intel_crtc *intel_crtc)
if (pll == NULL) if (pll == NULL)
return; return;
BUG_ON(pll->refcount == 0); if (WARN_ON(pll->refcount == 0))
return;
DRM_DEBUG_KMS("disable PCH PLL %x (active %d, on? %d) for crtc %d\n", DRM_DEBUG_KMS("disable PCH PLL %x (active %d, on? %d) for crtc %d\n",
pll->pll_reg, pll->active, pll->on, pll->pll_reg, pll->active, pll->on,
intel_crtc->base.base.id); intel_crtc->base.base.id);
BUG_ON(pll->active == 0); if (WARN_ON(pll->active == 0)) {
assert_pch_pll_disabled(dev_priv, intel_crtc);
return;
}
if (--pll->active) { if (--pll->active) {
assert_pch_pll_enabled(dev_priv, intel_crtc); assert_pch_pll_enabled(dev_priv, intel_crtc);
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册