Commit d67c0ac1 authored by Jani Nikula's avatar Jani Nikula

drm/i915: reduce indent in pch detection

Save some horizontal space.
Reviewed-by: default avatarDavid Weinehall <david.weinehall@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180202130416.18233-1-jani.nikula@intel.com
parent fae919f0
...@@ -182,100 +182,103 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv) ...@@ -182,100 +182,103 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
* of only checking the first one. * of only checking the first one.
*/ */
while ((pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, pch))) { while ((pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, pch))) {
if (pch->vendor == PCI_VENDOR_ID_INTEL) { unsigned short id;
unsigned short id = pch->device & INTEL_PCH_DEVICE_ID_MASK;
if (pch->vendor != PCI_VENDOR_ID_INTEL)
dev_priv->pch_id = id; continue;
if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) { id = pch->device & INTEL_PCH_DEVICE_ID_MASK;
dev_priv->pch_type = PCH_IBX;
DRM_DEBUG_KMS("Found Ibex Peak PCH\n"); dev_priv->pch_id = id;
WARN_ON(!IS_GEN5(dev_priv));
} else if (id == INTEL_PCH_CPT_DEVICE_ID_TYPE) { if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) {
dev_priv->pch_type = PCH_CPT; dev_priv->pch_type = PCH_IBX;
DRM_DEBUG_KMS("Found CougarPoint PCH\n"); DRM_DEBUG_KMS("Found Ibex Peak PCH\n");
WARN_ON(!IS_GEN6(dev_priv) && WARN_ON(!IS_GEN5(dev_priv));
!IS_IVYBRIDGE(dev_priv)); } else if (id == INTEL_PCH_CPT_DEVICE_ID_TYPE) {
} else if (id == INTEL_PCH_PPT_DEVICE_ID_TYPE) { dev_priv->pch_type = PCH_CPT;
/* PantherPoint is CPT compatible */ DRM_DEBUG_KMS("Found CougarPoint PCH\n");
dev_priv->pch_type = PCH_CPT; WARN_ON(!IS_GEN6(dev_priv) &&
DRM_DEBUG_KMS("Found PantherPoint PCH\n"); !IS_IVYBRIDGE(dev_priv));
WARN_ON(!IS_GEN6(dev_priv) && } else if (id == INTEL_PCH_PPT_DEVICE_ID_TYPE) {
!IS_IVYBRIDGE(dev_priv)); /* PantherPoint is CPT compatible */
} else if (id == INTEL_PCH_LPT_DEVICE_ID_TYPE) { dev_priv->pch_type = PCH_CPT;
dev_priv->pch_type = PCH_LPT; DRM_DEBUG_KMS("Found PantherPoint PCH\n");
DRM_DEBUG_KMS("Found LynxPoint PCH\n"); WARN_ON(!IS_GEN6(dev_priv) &&
WARN_ON(!IS_HASWELL(dev_priv) && !IS_IVYBRIDGE(dev_priv));
!IS_BROADWELL(dev_priv)); } else if (id == INTEL_PCH_LPT_DEVICE_ID_TYPE) {
WARN_ON(IS_HSW_ULT(dev_priv) || dev_priv->pch_type = PCH_LPT;
IS_BDW_ULT(dev_priv)); DRM_DEBUG_KMS("Found LynxPoint PCH\n");
} else if (id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) { WARN_ON(!IS_HASWELL(dev_priv) &&
dev_priv->pch_type = PCH_LPT; !IS_BROADWELL(dev_priv));
DRM_DEBUG_KMS("Found LynxPoint LP PCH\n"); WARN_ON(IS_HSW_ULT(dev_priv) ||
WARN_ON(!IS_HASWELL(dev_priv) && IS_BDW_ULT(dev_priv));
!IS_BROADWELL(dev_priv)); } else if (id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) {
WARN_ON(!IS_HSW_ULT(dev_priv) && dev_priv->pch_type = PCH_LPT;
!IS_BDW_ULT(dev_priv)); DRM_DEBUG_KMS("Found LynxPoint LP PCH\n");
} else if (id == INTEL_PCH_WPT_DEVICE_ID_TYPE) { WARN_ON(!IS_HASWELL(dev_priv) &&
/* WildcatPoint is LPT compatible */ !IS_BROADWELL(dev_priv));
dev_priv->pch_type = PCH_LPT; WARN_ON(!IS_HSW_ULT(dev_priv) &&
DRM_DEBUG_KMS("Found WildcatPoint PCH\n"); !IS_BDW_ULT(dev_priv));
WARN_ON(!IS_HASWELL(dev_priv) && } else if (id == INTEL_PCH_WPT_DEVICE_ID_TYPE) {
!IS_BROADWELL(dev_priv)); /* WildcatPoint is LPT compatible */
WARN_ON(IS_HSW_ULT(dev_priv) || dev_priv->pch_type = PCH_LPT;
IS_BDW_ULT(dev_priv)); DRM_DEBUG_KMS("Found WildcatPoint PCH\n");
} else if (id == INTEL_PCH_WPT_LP_DEVICE_ID_TYPE) { WARN_ON(!IS_HASWELL(dev_priv) &&
/* WildcatPoint is LPT compatible */ !IS_BROADWELL(dev_priv));
dev_priv->pch_type = PCH_LPT; WARN_ON(IS_HSW_ULT(dev_priv) ||
DRM_DEBUG_KMS("Found WildcatPoint LP PCH\n"); IS_BDW_ULT(dev_priv));
WARN_ON(!IS_HASWELL(dev_priv) && } else if (id == INTEL_PCH_WPT_LP_DEVICE_ID_TYPE) {
!IS_BROADWELL(dev_priv)); /* WildcatPoint is LPT compatible */
WARN_ON(!IS_HSW_ULT(dev_priv) && dev_priv->pch_type = PCH_LPT;
!IS_BDW_ULT(dev_priv)); DRM_DEBUG_KMS("Found WildcatPoint LP PCH\n");
} else if (id == INTEL_PCH_SPT_DEVICE_ID_TYPE) { WARN_ON(!IS_HASWELL(dev_priv) &&
dev_priv->pch_type = PCH_SPT; !IS_BROADWELL(dev_priv));
DRM_DEBUG_KMS("Found SunrisePoint PCH\n"); WARN_ON(!IS_HSW_ULT(dev_priv) &&
WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_BDW_ULT(dev_priv));
!IS_KABYLAKE(dev_priv)); } else if (id == INTEL_PCH_SPT_DEVICE_ID_TYPE) {
} else if (id == INTEL_PCH_SPT_LP_DEVICE_ID_TYPE) { dev_priv->pch_type = PCH_SPT;
dev_priv->pch_type = PCH_SPT; DRM_DEBUG_KMS("Found SunrisePoint PCH\n");
DRM_DEBUG_KMS("Found SunrisePoint LP PCH\n"); WARN_ON(!IS_SKYLAKE(dev_priv) &&
WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv));
!IS_KABYLAKE(dev_priv)); } else if (id == INTEL_PCH_SPT_LP_DEVICE_ID_TYPE) {
} else if (id == INTEL_PCH_KBP_DEVICE_ID_TYPE) { dev_priv->pch_type = PCH_SPT;
dev_priv->pch_type = PCH_KBP; DRM_DEBUG_KMS("Found SunrisePoint LP PCH\n");
DRM_DEBUG_KMS("Found Kaby Lake PCH (KBP)\n"); WARN_ON(!IS_SKYLAKE(dev_priv) &&
WARN_ON(!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv));
!IS_KABYLAKE(dev_priv) && } else if (id == INTEL_PCH_KBP_DEVICE_ID_TYPE) {
!IS_COFFEELAKE(dev_priv)); dev_priv->pch_type = PCH_KBP;
} else if (id == INTEL_PCH_CNP_DEVICE_ID_TYPE) { DRM_DEBUG_KMS("Found Kaby Lake PCH (KBP)\n");
dev_priv->pch_type = PCH_CNP; WARN_ON(!IS_SKYLAKE(dev_priv) &&
DRM_DEBUG_KMS("Found Cannon Lake PCH (CNP)\n"); !IS_KABYLAKE(dev_priv) &&
WARN_ON(!IS_CANNONLAKE(dev_priv) && !IS_COFFEELAKE(dev_priv));
!IS_COFFEELAKE(dev_priv)); } else if (id == INTEL_PCH_CNP_DEVICE_ID_TYPE) {
} else if (id == INTEL_PCH_CNP_LP_DEVICE_ID_TYPE) { dev_priv->pch_type = PCH_CNP;
dev_priv->pch_type = PCH_CNP; DRM_DEBUG_KMS("Found Cannon Lake PCH (CNP)\n");
DRM_DEBUG_KMS("Found Cannon Lake LP PCH (CNP-LP)\n"); WARN_ON(!IS_CANNONLAKE(dev_priv) &&
WARN_ON(!IS_CANNONLAKE(dev_priv) && !IS_COFFEELAKE(dev_priv));
!IS_COFFEELAKE(dev_priv)); } else if (id == INTEL_PCH_CNP_LP_DEVICE_ID_TYPE) {
} else if (id == INTEL_PCH_ICP_DEVICE_ID_TYPE) { dev_priv->pch_type = PCH_CNP;
dev_priv->pch_type = PCH_ICP; DRM_DEBUG_KMS("Found Cannon Lake LP PCH (CNP-LP)\n");
DRM_DEBUG_KMS("Found Ice Lake PCH\n"); WARN_ON(!IS_CANNONLAKE(dev_priv) &&
WARN_ON(!IS_ICELAKE(dev_priv)); !IS_COFFEELAKE(dev_priv));
} else if (id == INTEL_PCH_P2X_DEVICE_ID_TYPE || } else if (id == INTEL_PCH_ICP_DEVICE_ID_TYPE) {
id == INTEL_PCH_P3X_DEVICE_ID_TYPE || dev_priv->pch_type = PCH_ICP;
(id == INTEL_PCH_QEMU_DEVICE_ID_TYPE && DRM_DEBUG_KMS("Found Ice Lake PCH\n");
pch->subsystem_vendor == WARN_ON(!IS_ICELAKE(dev_priv));
PCI_SUBVENDOR_ID_REDHAT_QUMRANET && } else if (id == INTEL_PCH_P2X_DEVICE_ID_TYPE ||
pch->subsystem_device == id == INTEL_PCH_P3X_DEVICE_ID_TYPE ||
PCI_SUBDEVICE_ID_QEMU)) { (id == INTEL_PCH_QEMU_DEVICE_ID_TYPE &&
dev_priv->pch_type = pch->subsystem_vendor ==
intel_virt_detect_pch(dev_priv); PCI_SUBVENDOR_ID_REDHAT_QUMRANET &&
} else pch->subsystem_device ==
continue; PCI_SUBDEVICE_ID_QEMU)) {
dev_priv->pch_type = intel_virt_detect_pch(dev_priv);
break; } else {
continue;
} }
break;
} }
if (!pch) if (!pch)
DRM_DEBUG_KMS("No PCH found.\n"); DRM_DEBUG_KMS("No PCH found.\n");
......
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