diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-06-01 04:49:16 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-06-01 04:52:54 -0400 |
commit | e269f90f3d3f7c70cf661c660bf445597261f54a (patch) | |
tree | f09685517e9efa7d675dad8fd13694157ce50521 /drivers/gpu/drm/i915/intel_display.c | |
parent | 112abd291db7d47974f166e742104d761bc76977 (diff) | |
parent | 63bc620b45af8c743ac291c8725933278c712692 (diff) |
Merge remote-tracking branch 'airlied/drm-prime-vmap' into drm-intel-next-queued
We need the latest dma-buf code from Dave Airlie so that we can pimp
the backing storage handling code in drm/i915 with Chris Wilson's
unbound tracking and stolen mem backed gem object code.
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 58 |
1 files changed, 34 insertions, 24 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 1d801724c1db..9f5148acf73c 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -910,9 +910,10 @@ static void assert_pll(struct drm_i915_private *dev_priv, | |||
910 | 910 | ||
911 | /* For ILK+ */ | 911 | /* For ILK+ */ |
912 | static void assert_pch_pll(struct drm_i915_private *dev_priv, | 912 | static void assert_pch_pll(struct drm_i915_private *dev_priv, |
913 | struct intel_crtc *intel_crtc, bool state) | 913 | struct intel_pch_pll *pll, |
914 | struct intel_crtc *crtc, | ||
915 | bool state) | ||
914 | { | 916 | { |
915 | int reg; | ||
916 | u32 val; | 917 | u32 val; |
917 | bool cur_state; | 918 | bool cur_state; |
918 | 919 | ||
@@ -921,30 +922,37 @@ static void assert_pch_pll(struct drm_i915_private *dev_priv, | |||
921 | return; | 922 | return; |
922 | } | 923 | } |
923 | 924 | ||
924 | if (!intel_crtc->pch_pll) { | 925 | if (WARN (!pll, |
925 | WARN(1, "asserting PCH PLL enabled with no PLL\n"); | 926 | "asserting PCH PLL %s with no PLL\n", state_string(state))) |
926 | return; | 927 | return; |
927 | } | ||
928 | 928 | ||
929 | if (HAS_PCH_CPT(dev_priv->dev)) { | 929 | val = I915_READ(pll->pll_reg); |
930 | cur_state = !!(val & DPLL_VCO_ENABLE); | ||
931 | WARN(cur_state != state, | ||
932 | "PCH PLL state for reg %x assertion failure (expected %s, current %s), val=%08x\n", | ||
933 | pll->pll_reg, state_string(state), state_string(cur_state), val); | ||
934 | |||
935 | /* Make sure the selected PLL is correctly attached to the transcoder */ | ||
936 | if (crtc && HAS_PCH_CPT(dev_priv->dev)) { | ||
930 | u32 pch_dpll; | 937 | u32 pch_dpll; |
931 | 938 | ||
932 | pch_dpll = I915_READ(PCH_DPLL_SEL); | 939 | pch_dpll = I915_READ(PCH_DPLL_SEL); |
933 | 940 | cur_state = pll->pll_reg == _PCH_DPLL_B; | |
934 | /* Make sure the selected PLL is enabled to the transcoder */ | 941 | if (!WARN(((pch_dpll >> (4 * crtc->pipe)) & 1) != cur_state, |
935 | WARN(!((pch_dpll >> (4 * intel_crtc->pipe)) & 8), | 942 | "PLL[%d] not attached to this transcoder %d: %08x\n", |
936 | "transcoder %d PLL not enabled\n", intel_crtc->pipe); | 943 | cur_state, crtc->pipe, pch_dpll)) { |
944 | cur_state = !!(val >> (4*crtc->pipe + 3)); | ||
945 | WARN(cur_state != state, | ||
946 | "PLL[%d] not %s on this transcoder %d: %08x\n", | ||
947 | pll->pll_reg == _PCH_DPLL_B, | ||
948 | state_string(state), | ||
949 | crtc->pipe, | ||
950 | val); | ||
951 | } | ||
937 | } | 952 | } |
938 | |||
939 | reg = intel_crtc->pch_pll->pll_reg; | ||
940 | val = I915_READ(reg); | ||
941 | cur_state = !!(val & DPLL_VCO_ENABLE); | ||
942 | WARN(cur_state != state, | ||
943 | "PCH PLL state assertion failure (expected %s, current %s)\n", | ||
944 | state_string(state), state_string(cur_state)); | ||
945 | } | 953 | } |
946 | #define assert_pch_pll_enabled(d, p) assert_pch_pll(d, p, true) | 954 | #define assert_pch_pll_enabled(d, p, c) assert_pch_pll(d, p, c, true) |
947 | #define assert_pch_pll_disabled(d, p) assert_pch_pll(d, p, false) | 955 | #define assert_pch_pll_disabled(d, p, c) assert_pch_pll(d, p, c, false) |
948 | 956 | ||
949 | static void assert_fdi_tx(struct drm_i915_private *dev_priv, | 957 | static void assert_fdi_tx(struct drm_i915_private *dev_priv, |
950 | enum pipe pipe, bool state) | 958 | enum pipe pipe, bool state) |
@@ -1424,7 +1432,7 @@ static void intel_enable_pch_pll(struct intel_crtc *intel_crtc) | |||
1424 | assert_pch_refclk_enabled(dev_priv); | 1432 | assert_pch_refclk_enabled(dev_priv); |
1425 | 1433 | ||
1426 | if (pll->active++ && pll->on) { | 1434 | if (pll->active++ && pll->on) { |
1427 | assert_pch_pll_enabled(dev_priv, intel_crtc); | 1435 | assert_pch_pll_enabled(dev_priv, pll, NULL); |
1428 | return; | 1436 | return; |
1429 | } | 1437 | } |
1430 | 1438 | ||
@@ -1460,12 +1468,12 @@ static void intel_disable_pch_pll(struct intel_crtc *intel_crtc) | |||
1460 | intel_crtc->base.base.id); | 1468 | intel_crtc->base.base.id); |
1461 | 1469 | ||
1462 | if (WARN_ON(pll->active == 0)) { | 1470 | if (WARN_ON(pll->active == 0)) { |
1463 | assert_pch_pll_disabled(dev_priv, intel_crtc); | 1471 | assert_pch_pll_disabled(dev_priv, pll, NULL); |
1464 | return; | 1472 | return; |
1465 | } | 1473 | } |
1466 | 1474 | ||
1467 | if (--pll->active) { | 1475 | if (--pll->active) { |
1468 | assert_pch_pll_enabled(dev_priv, intel_crtc); | 1476 | assert_pch_pll_enabled(dev_priv, pll, NULL); |
1469 | return; | 1477 | return; |
1470 | } | 1478 | } |
1471 | 1479 | ||
@@ -1495,7 +1503,9 @@ static void intel_enable_transcoder(struct drm_i915_private *dev_priv, | |||
1495 | BUG_ON(dev_priv->info->gen < 5); | 1503 | BUG_ON(dev_priv->info->gen < 5); |
1496 | 1504 | ||
1497 | /* Make sure PCH DPLL is enabled */ | 1505 | /* Make sure PCH DPLL is enabled */ |
1498 | assert_pch_pll_enabled(dev_priv, to_intel_crtc(crtc)); | 1506 | assert_pch_pll_enabled(dev_priv, |
1507 | to_intel_crtc(crtc)->pch_pll, | ||
1508 | to_intel_crtc(crtc)); | ||
1499 | 1509 | ||
1500 | /* FDI must be feeding us bits for PCH ports */ | 1510 | /* FDI must be feeding us bits for PCH ports */ |
1501 | assert_fdi_tx_enabled(dev_priv, pipe); | 1511 | assert_fdi_tx_enabled(dev_priv, pipe); |
@@ -6918,7 +6928,7 @@ void intel_modeset_init(struct drm_device *dev) | |||
6918 | dev->mode_config.preferred_depth = 24; | 6928 | dev->mode_config.preferred_depth = 24; |
6919 | dev->mode_config.prefer_shadow = 1; | 6929 | dev->mode_config.prefer_shadow = 1; |
6920 | 6930 | ||
6921 | dev->mode_config.funcs = (void *)&intel_mode_funcs; | 6931 | dev->mode_config.funcs = &intel_mode_funcs; |
6922 | 6932 | ||
6923 | intel_init_quirks(dev); | 6933 | intel_init_quirks(dev); |
6924 | 6934 | ||