From: Rui Guo <firemeteor@users.sourceforge.net>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH] Fix PCH detect with multiple ISA bridges in VM
Date: Wed, 19 Jun 2013 21:10:23 +0800 [thread overview]
Message-ID: <1371647423-11272-1-git-send-email-firemeteor@users.sourceforge.net> (raw)
In-Reply-To: <CAKMK7uEqB4aF_Jgg8FdHkegZTFrnjod8DU7ubuTSevNiAjK2gg@mail.gmail.com>
In some virtualized environments (e.g. XEN), there is irrelevant ISA bridge in
the system. To work reliably, we should scan trhough all the ISA bridge
devices and check for the first match, instead of only checking the first one.
Signed-off-by: Rui Guo <firemeteor@users.sourceforge.net>
---
drivers/gpu/drm/i915/i915_drv.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index a2e4953..10316dc 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -454,9 +454,15 @@ void intel_detect_pch(struct drm_device *dev)
* make graphics device passthrough work easy for VMM, that only
* need to expose ISA bridge to let driver know the real hardware
* underneath. This is a requirement from virtualization team.
+ *
+ * In some virtualized environments (e.g. XEN), there is irrelevant
+ * ISA bridge in the system. To work reliably, we should scan trhough
+ * all the ISA bridge devices and check for the first match, instead
+ * of only checking the first one.
*/
pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL);
- if (pch) {
+ while (pch) {
+ struct pci_dev *curr = pch;
if (pch->vendor == PCI_VENDOR_ID_INTEL) {
unsigned short id;
id = pch->device & INTEL_PCH_DEVICE_ID_MASK;
@@ -490,11 +496,20 @@ void intel_detect_pch(struct drm_device *dev)
DRM_DEBUG_KMS("Found LynxPoint LP PCH\n");
WARN_ON(!IS_HASWELL(dev));
WARN_ON(!IS_ULT(dev));
+ } else {
+ goto check_next;
}
+
BUG_ON(dev_priv->num_pch_pll > I915_NUM_PLLS);
+ pci_dev_put(pch);
+ break;
}
- pci_dev_put(pch);
+check_next:
+ pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, curr);
+ pci_dev_put(curr);
}
+ if (!pch)
+ DRM_DEBUG_KMS("No PCH found?\n");
}
bool i915_semaphore_is_enabled(struct drm_device *dev)
--
1.7.10.4
next prev parent reply other threads:[~2013-06-19 13:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-18 16:49 [PATCH] Fix intel_detect_pch() to work in xen environment G.R.
2012-12-18 16:53 ` Jesse Barnes
2012-12-18 17:43 ` G.R.
2012-12-18 18:20 ` Jesse Barnes
2012-12-19 3:40 ` G.R.
2012-12-20 4:04 ` G.R.
2012-12-20 16:13 ` Jesse Barnes
2012-12-23 6:51 ` G.R.
2013-06-18 12:54 ` G.R.
2013-06-19 6:01 ` Daniel Vetter
2013-06-19 13:10 ` Rui Guo [this message]
2013-06-19 15:29 ` G.R.
2013-06-20 12:01 ` Daniel Vetter
2013-06-19 7:57 ` Ville Syrjälä
2012-12-18 17:21 ` Ben Widawsky
2012-12-19 4:01 ` G.R.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371647423-11272-1-git-send-email-firemeteor@users.sourceforge.net \
--to=firemeteor@users.sourceforge.net \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.