diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-05-13 15:16:12 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-05-19 17:09:50 -0400 |
commit | 48da64a8bf2e00952fcd3ad108babae5e003a03d (patch) | |
tree | cf45fa7be36c5d59826bb5a4af16ce2bd4485f45 /drivers/gpu/drm/i915 | |
parent | a9dcf84b14ef4e9a609910367576995e6f32f3dc (diff) |
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: Chris Wilson <chris@chris-wilson.co.uk>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 956b22899b7..9dc42bf557b 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -1403,14 +1403,18 @@ out_unlock: | |||
1403 | static void intel_enable_pch_pll(struct intel_crtc *intel_crtc) | 1403 | static void intel_enable_pch_pll(struct intel_crtc *intel_crtc) |
1404 | { | 1404 | { |
1405 | struct drm_i915_private *dev_priv = intel_crtc->base.dev->dev_private; | 1405 | struct drm_i915_private *dev_priv = intel_crtc->base.dev->dev_private; |
1406 | struct intel_pch_pll *pll = intel_crtc->pch_pll; | 1406 | struct intel_pch_pll *pll; |
1407 | int reg; | 1407 | int reg; |
1408 | u32 val; | 1408 | u32 val; |
1409 | 1409 | ||
1410 | /* PCH only available on ILK+ */ | 1410 | /* PCH PLLs only available on ILK, SNB and IVB */ |
1411 | BUG_ON(dev_priv->info->gen < 5); | 1411 | BUG_ON(dev_priv->info->gen < 5); |
1412 | BUG_ON(pll == NULL); | 1412 | pll = intel_crtc->pch_pll; |
1413 | BUG_ON(pll->refcount == 0); | 1413 | if (pll == NULL) |
1414 | return; | ||
1415 | |||
1416 | if (WARN_ON(pll->refcount == 0)) | ||
1417 | return; | ||
1414 | 1418 | ||
1415 | DRM_DEBUG_KMS("enable PCH PLL %x (active %d, on? %d)for crtc %d\n", | 1419 | DRM_DEBUG_KMS("enable PCH PLL %x (active %d, on? %d)for crtc %d\n", |
1416 | pll->pll_reg, pll->active, pll->on, | 1420 | pll->pll_reg, pll->active, pll->on, |
@@ -1448,13 +1452,18 @@ static void intel_disable_pch_pll(struct intel_crtc *intel_crtc) | |||
1448 | if (pll == NULL) | 1452 | if (pll == NULL) |
1449 | return; | 1453 | return; |
1450 | 1454 | ||
1451 | BUG_ON(pll->refcount == 0); | 1455 | if (WARN_ON(pll->refcount == 0)) |
1456 | return; | ||
1452 | 1457 | ||
1453 | DRM_DEBUG_KMS("disable PCH PLL %x (active %d, on? %d) for crtc %d\n", | 1458 | DRM_DEBUG_KMS("disable PCH PLL %x (active %d, on? %d) for crtc %d\n", |
1454 | pll->pll_reg, pll->active, pll->on, | 1459 | pll->pll_reg, pll->active, pll->on, |
1455 | intel_crtc->base.base.id); | 1460 | intel_crtc->base.base.id); |
1456 | 1461 | ||
1457 | BUG_ON(pll->active == 0); | 1462 | if (WARN_ON(pll->active == 0)) { |
1463 | assert_pch_pll_disabled(dev_priv, intel_crtc); | ||
1464 | return; | ||
1465 | } | ||
1466 | |||
1458 | if (--pll->active) { | 1467 | if (--pll->active) { |
1459 | assert_pch_pll_enabled(dev_priv, intel_crtc); | 1468 | assert_pch_pll_enabled(dev_priv, intel_crtc); |
1460 | return; | 1469 | return; |