aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.c')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 04f1f02c4019..ec7bb0fc71bc 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -403,7 +403,7 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
403void intel_detect_pch(struct drm_device *dev) 403void intel_detect_pch(struct drm_device *dev)
404{ 404{
405 struct drm_i915_private *dev_priv = dev->dev_private; 405 struct drm_i915_private *dev_priv = dev->dev_private;
406 struct pci_dev *pch; 406 struct pci_dev *pch = NULL;
407 407
408 /* In all current cases, num_pipes is equivalent to the PCH_NOP setting 408 /* In all current cases, num_pipes is equivalent to the PCH_NOP setting
409 * (which really amounts to a PCH but no South Display). 409 * (which really amounts to a PCH but no South Display).
@@ -424,12 +424,9 @@ void intel_detect_pch(struct drm_device *dev)
424 * all the ISA bridge devices and check for the first match, instead 424 * all the ISA bridge devices and check for the first match, instead
425 * of only checking the first one. 425 * of only checking the first one.
426 */ 426 */
427 pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL); 427 while ((pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, pch))) {
428 while (pch) {
429 struct pci_dev *curr = pch;
430 if (pch->vendor == PCI_VENDOR_ID_INTEL) { 428 if (pch->vendor == PCI_VENDOR_ID_INTEL) {
431 unsigned short id; 429 unsigned short id = pch->device & INTEL_PCH_DEVICE_ID_MASK;
432 id = pch->device & INTEL_PCH_DEVICE_ID_MASK;
433 dev_priv->pch_id = id; 430 dev_priv->pch_id = id;
434 431
435 if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) { 432 if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) {
@@ -461,18 +458,16 @@ void intel_detect_pch(struct drm_device *dev)
461 DRM_DEBUG_KMS("Found LynxPoint LP PCH\n"); 458 DRM_DEBUG_KMS("Found LynxPoint LP PCH\n");
462 WARN_ON(!IS_HASWELL(dev)); 459 WARN_ON(!IS_HASWELL(dev));
463 WARN_ON(!IS_ULT(dev)); 460 WARN_ON(!IS_ULT(dev));
464 } else { 461 } else
465 goto check_next; 462 continue;
466 } 463
467 pci_dev_put(pch);
468 break; 464 break;
469 } 465 }
470check_next:
471 pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, curr);
472 pci_dev_put(curr);
473 } 466 }
474 if (!pch) 467 if (!pch)
475 DRM_DEBUG_KMS("No PCH found?\n"); 468 DRM_DEBUG_KMS("No PCH found.\n");
469
470 pci_dev_put(pch);
476} 471}
477 472
478bool i915_semaphore_is_enabled(struct drm_device *dev) 473bool i915_semaphore_is_enabled(struct drm_device *dev)