···132132 list_for_each_entry((intel_encoder), &(dev)->mode_config.encoder_list, base.head) \133133 if ((intel_encoder)->base.crtc == (__crtc))134134135135-struct intel_shared_dpll {136136- int refcount; /* count of number of CRTCs sharing this PLL */137137- int active; /* count of number of active CRTCs (i.e. DPMS on) */138138- bool on; /* is the PLL actually active? Disabled during modeset */139139- int pll_reg;140140- int fp0_reg;141141- int fp1_reg;142142-};143143-144135enum intel_dpll_id {145136 DPLL_ID_PRIVATE = -1, /* non-shared dpll in use */146137 /* real shared dpll ids must be >= 0 */···139148 DPLL_ID_PCH_PLL_B,140149};141150#define I915_NUM_PLLS 2151151+152152+struct intel_shared_dpll {153153+ int refcount; /* count of number of CRTCs sharing this PLL */154154+ int active; /* count of number of active CRTCs (i.e. DPMS on) */155155+ bool on; /* is the PLL actually active? Disabled during modeset */156156+ const char *name;157157+ /* should match the index in the dev_priv->shared_dplls array */158158+ enum intel_dpll_id id;159159+ int pll_reg;160160+ int fp0_reg;161161+ int fp1_reg;162162+};142163143164/* Used by dp and fdi links */144165struct intel_link_m_n {
+28-20
drivers/gpu/drm/i915/intel_display.c
···935935 }936936937937 if (WARN (!pll,938938- "asserting PCH PLL %s with no PLL\n", state_string(state)))938938+ "asserting DPLL %s with no DPLL\n", state_string(state)))939939 return;940940941941 val = I915_READ(pll->pll_reg);942942 cur_state = !!(val & DPLL_VCO_ENABLE);943943 WARN(cur_state != state,944944- "PCH PLL state for reg %x assertion failure (expected %s, current %s), val=%08x\n",945945- pll->pll_reg, state_string(state), state_string(cur_state), val);944944+ "%s assertion failure (expected %s, current %s), val=%08x\n",945945+ pll->name, state_string(state), state_string(cur_state), val);946946947947 /* Make sure the selected PLL is correctly attached to the transcoder */948948 if (crtc && HAS_PCH_CPT(dev_priv->dev)) {···14301430 if (WARN_ON(pll->refcount == 0))14311431 return;1432143214331433- DRM_DEBUG_KMS("enable PCH PLL %x (active %d, on? %d)for crtc %d\n",14341434- pll->pll_reg, pll->active, pll->on,14331433+ DRM_DEBUG_KMS("enable %s (active %d, on? %d)for crtc %d\n",14341434+ pll->name, pll->active, pll->on,14351435 crtc->base.base.id);1436143614371437 /* PCH refclock must be enabled first */···14441444 }14451445 WARN_ON(pll->on);1446144614471447- DRM_DEBUG_KMS("enabling PCH PLL %x\n", pll->pll_reg);14471447+ DRM_DEBUG_KMS("enabling %s\n", pll->name);1448144814491449 reg = pll->pll_reg;14501450 val = I915_READ(reg);···14711471 if (WARN_ON(pll->refcount == 0))14721472 return;1473147314741474- DRM_DEBUG_KMS("disable PCH PLL %x (active %d, on? %d) for crtc %d\n",14751475- pll->pll_reg, pll->active, pll->on,14741474+ DRM_DEBUG_KMS("disable %s (active %d, on? %d) for crtc %d\n",14751475+ pll->name, pll->active, pll->on,14761476 crtc->base.base.id);1477147714781478 if (WARN_ON(pll->active == 0)) {···14851485 if (--pll->active)14861486 return;1487148714881488- DRM_DEBUG_KMS("disabling PCH PLL %x\n", pll->pll_reg);14881488+ DRM_DEBUG_KMS("disabling %s\n", pll->name);1489148914901490 /* Make sure transcoder isn't still depending on us */14911491 assert_pch_transcoder_disabled(dev_priv, crtc->pipe);···30653065 return;3066306630673067 if (pll->refcount == 0) {30683068- WARN(1, "bad PCH PLL refcount\n");30683068+ WARN(1, "bad %s refcount\n", pll->name);30693069 return;30703070 }30713071···30843084 enum intel_dpll_id i;3085308530863086 if (pll) {30873087- DRM_DEBUG_KMS("CRTC:%d dropping existing PCH PLL %x\n",30883088- crtc->base.base.id, pll->pll_reg);30873087+ DRM_DEBUG_KMS("CRTC:%d dropping existing %s\n",30883088+ crtc->base.base.id, pll->name);30893089 intel_put_shared_dpll(crtc);30903090 }30913091···30943094 i = crtc->pipe;30953095 pll = &dev_priv->shared_dplls[i];3096309630973097- DRM_DEBUG_KMS("CRTC:%d using pre-allocated PCH PLL %x\n",30983098- crtc->base.base.id, pll->pll_reg);30973097+ DRM_DEBUG_KMS("CRTC:%d using pre-allocated %s\n",30983098+ crtc->base.base.id, pll->name);3099309931003100 goto found;31013101 }···3109310931103110 if (dpll == (I915_READ(pll->pll_reg) & 0x7fffffff) &&31113111 fp == I915_READ(pll->fp0_reg)) {31123112- DRM_DEBUG_KMS("CRTC:%d sharing existing PCH PLL %x (refcount %d, ative %d)\n",31123112+ DRM_DEBUG_KMS("CRTC:%d sharing existing %s (refcount %d, ative %d)\n",31133113 crtc->base.base.id,31143114- pll->pll_reg, pll->refcount, pll->active);31143114+ pll->name, pll->refcount, pll->active);3115311531163116 goto found;31173117 }···31213121 for (i = 0; i < dev_priv->num_shared_dpll; i++) {31223122 pll = &dev_priv->shared_dplls[i];31233123 if (pll->refcount == 0) {31243124- DRM_DEBUG_KMS("CRTC:%d allocated PCH PLL %x\n",31253125- crtc->base.base.id, pll->pll_reg);31243124+ DRM_DEBUG_KMS("CRTC:%d allocated %s\n",31253125+ crtc->base.base.id, pll->name);31263126 goto found;31273127 }31283128 }···3131313131323132found:31333133 crtc->config.shared_dpll = i;31343134- DRM_DEBUG_DRIVER("using pll %d for pipe %c\n", i, pipe_name(crtc->pipe));31343134+ DRM_DEBUG_DRIVER("using %s for pipe %c\n", pll->name,31353135+ pipe_name(crtc->pipe));31353136 if (pll->active == 0) {31363136- DRM_DEBUG_DRIVER("setting up pll %d\n", i);31373137+ DRM_DEBUG_DRIVER("setting up %s\n", pll->name);31373138 WARN_ON(pll->on);31383139 assert_shared_dpll_disabled(dev_priv, pll, NULL);31393140···87298728 intel_ddi_pll_init(dev);87308729}8731873087318731+static char *ibx_pch_dpll_names[] = {87328732+ "PCH DPLL A",87338733+ "PCH DPLL B",87348734+};87358735+87328736static void ibx_pch_dpll_init(struct drm_device *dev)87338737{87348738 drm_i915_private_t *dev_priv = dev->dev_private;···87428736 dev_priv->num_shared_dpll = 2;8743873787448738 for (i = 0; i < dev_priv->num_shared_dpll; i++) {87398739+ dev_priv->shared_dplls[i].id = i;87408740+ dev_priv->shared_dplls[i].name = ibx_pch_dpll_names[i];87458741 dev_priv->shared_dplls[i].pll_reg = _PCH_DPLL(i);87468742 dev_priv->shared_dplls[i].fp0_reg = _PCH_FP0(i);87478743 dev_priv->shared_dplls[i].fp1_reg = _PCH_FP1(i);