Commit 7c74ade1 authored by Daniel Vetter's avatar Daniel Vetter

drm/i915: consolidate ->num_shared_dplls assignement

In the future this won't be just for pch plls, so move it into the
shared dpll init code.

v2: Bikeshed the uncessary {} away while applying to appease
checkpatch.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v1)
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent c0d43d62
...@@ -433,7 +433,6 @@ void intel_detect_pch(struct drm_device *dev) ...@@ -433,7 +433,6 @@ void intel_detect_pch(struct drm_device *dev)
*/ */
if (INTEL_INFO(dev)->num_pipes == 0) { if (INTEL_INFO(dev)->num_pipes == 0) {
dev_priv->pch_type = PCH_NOP; dev_priv->pch_type = PCH_NOP;
dev_priv->num_shared_dpll = 0;
return; return;
} }
...@@ -452,34 +451,28 @@ void intel_detect_pch(struct drm_device *dev) ...@@ -452,34 +451,28 @@ void intel_detect_pch(struct drm_device *dev)
if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) { if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) {
dev_priv->pch_type = PCH_IBX; dev_priv->pch_type = PCH_IBX;
dev_priv->num_shared_dpll = 2;
DRM_DEBUG_KMS("Found Ibex Peak PCH\n"); DRM_DEBUG_KMS("Found Ibex Peak PCH\n");
WARN_ON(!IS_GEN5(dev)); WARN_ON(!IS_GEN5(dev));
} else if (id == INTEL_PCH_CPT_DEVICE_ID_TYPE) { } else if (id == INTEL_PCH_CPT_DEVICE_ID_TYPE) {
dev_priv->pch_type = PCH_CPT; dev_priv->pch_type = PCH_CPT;
dev_priv->num_shared_dpll = 2;
DRM_DEBUG_KMS("Found CougarPoint PCH\n"); DRM_DEBUG_KMS("Found CougarPoint PCH\n");
WARN_ON(!(IS_GEN6(dev) || IS_IVYBRIDGE(dev))); WARN_ON(!(IS_GEN6(dev) || IS_IVYBRIDGE(dev)));
} else if (id == INTEL_PCH_PPT_DEVICE_ID_TYPE) { } else if (id == INTEL_PCH_PPT_DEVICE_ID_TYPE) {
/* PantherPoint is CPT compatible */ /* PantherPoint is CPT compatible */
dev_priv->pch_type = PCH_CPT; dev_priv->pch_type = PCH_CPT;
dev_priv->num_shared_dpll = 2;
DRM_DEBUG_KMS("Found PatherPoint PCH\n"); DRM_DEBUG_KMS("Found PatherPoint PCH\n");
WARN_ON(!(IS_GEN6(dev) || IS_IVYBRIDGE(dev))); WARN_ON(!(IS_GEN6(dev) || IS_IVYBRIDGE(dev)));
} else if (id == INTEL_PCH_LPT_DEVICE_ID_TYPE) { } else if (id == INTEL_PCH_LPT_DEVICE_ID_TYPE) {
dev_priv->pch_type = PCH_LPT; dev_priv->pch_type = PCH_LPT;
dev_priv->num_shared_dpll = 0;
DRM_DEBUG_KMS("Found LynxPoint PCH\n"); DRM_DEBUG_KMS("Found LynxPoint PCH\n");
WARN_ON(!IS_HASWELL(dev)); WARN_ON(!IS_HASWELL(dev));
WARN_ON(IS_ULT(dev)); WARN_ON(IS_ULT(dev));
} else if (id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) { } else if (id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) {
dev_priv->pch_type = PCH_LPT; dev_priv->pch_type = PCH_LPT;
dev_priv->num_shared_dpll = 0;
DRM_DEBUG_KMS("Found LynxPoint LP PCH\n"); DRM_DEBUG_KMS("Found LynxPoint LP PCH\n");
WARN_ON(!IS_HASWELL(dev)); WARN_ON(!IS_HASWELL(dev));
WARN_ON(!IS_ULT(dev)); WARN_ON(!IS_ULT(dev));
} }
BUG_ON(dev_priv->num_shared_dpll > I915_NUM_PLLS);
} }
pci_dev_put(pch); pci_dev_put(pch);
} }
......
...@@ -8728,15 +8728,12 @@ static void intel_cpu_pll_init(struct drm_device *dev) ...@@ -8728,15 +8728,12 @@ static void intel_cpu_pll_init(struct drm_device *dev)
intel_ddi_pll_init(dev); intel_ddi_pll_init(dev);
} }
static void intel_shared_dpll_init(struct drm_device *dev) static void ibx_pch_dpll_init(struct drm_device *dev)
{ {
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
int i; int i;
if (dev_priv->num_shared_dpll == 0) { dev_priv->num_shared_dpll = 2;
DRM_DEBUG_KMS("No PCH PLLs on this hardware, skipping initialisation\n");
return;
}
for (i = 0; i < dev_priv->num_shared_dpll; i++) { for (i = 0; i < dev_priv->num_shared_dpll; i++) {
dev_priv->shared_dplls[i].pll_reg = _PCH_DPLL(i); dev_priv->shared_dplls[i].pll_reg = _PCH_DPLL(i);
...@@ -8745,6 +8742,20 @@ static void intel_shared_dpll_init(struct drm_device *dev) ...@@ -8745,6 +8742,20 @@ static void intel_shared_dpll_init(struct drm_device *dev)
} }
} }
static void intel_shared_dpll_init(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
if (HAS_PCH_IBX(dev) || HAS_PCH_CPT(dev))
ibx_pch_dpll_init(dev);
else
dev_priv->num_shared_dpll = 0;
BUG_ON(dev_priv->num_shared_dpll > I915_NUM_PLLS);
DRM_DEBUG_KMS("%i shared PLLs initialized\n",
dev_priv->num_shared_dpll);
}
static void intel_crtc_init(struct drm_device *dev, int pipe) static void intel_crtc_init(struct drm_device *dev, int pipe)
{ {
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
......
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