aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index deaa32e8113b..062cbda1bf4a 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -465,9 +465,15 @@ void intel_detect_pch(struct drm_device *dev)
465 * make graphics device passthrough work easy for VMM, that only 465 * make graphics device passthrough work easy for VMM, that only
466 * need to expose ISA bridge to let driver know the real hardware 466 * need to expose ISA bridge to let driver know the real hardware
467 * underneath. This is a requirement from virtualization team. 467 * underneath. This is a requirement from virtualization team.
468 *
469 * In some virtualized environments (e.g. XEN), there is irrelevant
470 * ISA bridge in the system. To work reliably, we should scan trhough
471 * all the ISA bridge devices and check for the first match, instead
472 * of only checking the first one.
468 */ 473 */
469 pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL); 474 pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL);
470 if (pch) { 475 while (pch) {
476 struct pci_dev *curr = pch;
471 if (pch->vendor == PCI_VENDOR_ID_INTEL) { 477 if (pch->vendor == PCI_VENDOR_ID_INTEL) {
472 unsigned short id; 478 unsigned short id;
473 id = pch->device & INTEL_PCH_DEVICE_ID_MASK; 479 id = pch->device & INTEL_PCH_DEVICE_ID_MASK;
@@ -496,10 +502,18 @@ void intel_detect_pch(struct drm_device *dev)
496 DRM_DEBUG_KMS("Found LynxPoint LP PCH\n"); 502 DRM_DEBUG_KMS("Found LynxPoint LP PCH\n");
497 WARN_ON(!IS_HASWELL(dev)); 503 WARN_ON(!IS_HASWELL(dev));
498 WARN_ON(!IS_ULT(dev)); 504 WARN_ON(!IS_ULT(dev));
505 } else {
506 goto check_next;
499 } 507 }
508 pci_dev_put(pch);
509 break;
500 } 510 }
501 pci_dev_put(pch); 511check_next:
512 pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, curr);
513 pci_dev_put(curr);
502 } 514 }
515 if (!pch)
516 DRM_DEBUG_KMS("No PCH found?\n");
503} 517}
504 518
505bool i915_semaphore_is_enabled(struct drm_device *dev) 519bool i915_semaphore_is_enabled(struct drm_device *dev)