All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] gpu:drm:i915:intel_detect_pch: back to check devfn instead of check class type
@ 2014-06-19  9:53 ` Tiejun Chen
  0 siblings, 0 replies; 75+ messages in thread
From: Tiejun Chen @ 2014-06-19  9:53 UTC (permalink / raw)
  To: daniel.vetter, jani.nikula, airlied
  Cc: intel-gfx, dri-devel, linux-kernel, xen-devel, qemu-devel

Originally the reason to probe ISA bridge instead of Dev31:Fun0
is to 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. Especially in that virtualized environments, XEN, there
is irrelevant ISA bridge in the system with that legacy qemu
version specific to xen, qemu-xen-traditional. So to work
reliably, we should scan through all the ISA bridge devices
and check for the first match, instead of only checking the
first one.

But actually, qemu-xen-traditional, is always enumerated with
Dev31:Fun0, 00:1f.0 as follows:

hw/pt-graphics.c:

intel_pch_init()
    |
    + pci_isa_bridge_init(bus, PCI_DEVFN(0x1f, 0), ...);

so this mean that isa bridge is still represented with Dev31:Func0
like the native OS. Furthermore, currently we're pushing VGA
passthrough support into qemu upstream, and with some discussion,
we wouldn't set the bridge class type and just expose this devfn.

So we just go back to check devfn to make life normal.

Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 651e65e..cb2526e 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -417,18 +417,8 @@ void intel_detect_pch(struct drm_device *dev)
 		return;
 	}
 
-	/*
-	 * The reason to probe ISA bridge instead of Dev31:Fun0 is to
-	 * 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.
-	 */
-	while ((pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, pch))) {
+	pch = pci_get_bus_and_slot(0, PCI_DEVFN(0x1f, 0));
+	if (pch) {
 		if (pch->vendor == PCI_VENDOR_ID_INTEL) {
 			unsigned short id = pch->device & INTEL_PCH_DEVICE_ID_MASK;
 			dev_priv->pch_id = id;
@@ -462,10 +452,7 @@ 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
-				continue;
-
-			break;
+			}
 		}
 	}
 	if (!pch)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 75+ messages in thread

end of thread, other threads:[~2014-07-12 10:13 UTC | newest]

Thread overview: 75+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-19  9:53 [RFC][PATCH] gpu:drm:i915:intel_detect_pch: back to check devfn instead of check class type Tiejun Chen
2014-06-19  9:53 ` Tiejun Chen
2014-06-19  9:53 ` [Qemu-devel] " Tiejun Chen
2014-06-20  9:40 ` Chen, Tiejun
2014-06-20  9:40   ` Chen, Tiejun
2014-06-20  9:40   ` [Qemu-devel] " Chen, Tiejun
2014-06-20 12:32   ` Daniel Vetter
2014-06-20 12:32     ` Daniel Vetter
2014-06-20 12:32     ` [Qemu-devel] " Daniel Vetter
2014-06-22  8:00     ` Chen, Tiejun
2014-06-22  8:00       ` Chen, Tiejun
2014-06-22  8:00       ` [Qemu-devel] " Chen, Tiejun
2014-06-20 12:48 ` Paolo Bonzini
2014-06-20 12:48   ` [Qemu-devel] " Paolo Bonzini
2014-06-22  8:25   ` Chen, Tiejun
2014-06-22  8:25     ` [Qemu-devel] " Chen, Tiejun
2014-06-25  6:48     ` Paolo Bonzini
2014-06-25  6:48       ` [Qemu-devel] " Paolo Bonzini
2014-06-25  7:34       ` Chen, Tiejun
2014-06-25  7:34         ` [Qemu-devel] " Chen, Tiejun
2014-06-25  7:55         ` Paolo Bonzini
2014-06-25  7:55           ` [Qemu-devel] " Paolo Bonzini
2014-06-30  3:13           ` Chen, Tiejun
2014-06-30  3:13             ` [Qemu-devel] " Chen, Tiejun
2014-06-30 10:56             ` Paolo Bonzini
2014-06-30 10:56               ` [Qemu-devel] " Paolo Bonzini
2014-07-07 14:49       ` Daniel Vetter
2014-07-07 14:49         ` Daniel Vetter
2014-07-07 14:49         ` [Qemu-devel] " Daniel Vetter
2014-07-07 14:57         ` Paolo Bonzini
2014-07-07 14:57           ` [Qemu-devel] " Paolo Bonzini
2014-07-07 17:54           ` [Intel-gfx] " Daniel Vetter
2014-07-07 17:54             ` Daniel Vetter
2014-07-07 17:54             ` [Qemu-devel] " Daniel Vetter
2014-07-07 17:58             ` Paolo Bonzini
2014-07-07 17:58               ` [Qemu-devel] " Paolo Bonzini
2014-07-07 18:40               ` Daniel Vetter
2014-07-07 18:40                 ` Daniel Vetter
2014-07-07 18:40                 ` [Qemu-devel] [Intel-gfx] " Daniel Vetter
2014-07-10 21:08                 ` Tian, Kevin
2014-07-10 21:08                   ` Tian, Kevin
2014-07-10 21:08                   ` [Qemu-devel] [Intel-gfx] " Tian, Kevin
2014-07-11  6:29                   ` Daniel Vetter
2014-07-11  6:29                     ` Daniel Vetter
2014-07-11  6:29                     ` [Qemu-devel] " Daniel Vetter
2014-07-11 19:42                     ` [Xen-devel] " Konrad Rzeszutek Wilk
2014-07-11 19:42                       ` [Xen-devel] " Konrad Rzeszutek Wilk
2014-07-11 19:42                       ` [Qemu-devel] [Xen-devel] [Intel-gfx] " Konrad Rzeszutek Wilk
2014-07-11 20:30                       ` Tian, Kevin
2014-07-11 20:30                         ` [Xen-devel] " Tian, Kevin
2014-07-11 20:30                         ` [Qemu-devel] [Xen-devel] [Intel-gfx] " Tian, Kevin
2014-07-12 10:13                         ` [Intel-gfx] [Xen-devel] " Daniel Vetter
2014-07-12 10:13                           ` Daniel Vetter
2014-07-12 10:13                           ` [Qemu-devel] [Intel-gfx] " Daniel Vetter
2014-06-24  2:59 ` [Intel-gfx] " Zhenyu Wang
2014-06-24  2:59   ` Zhenyu Wang
2014-06-24  2:59   ` [Qemu-devel] [Intel-gfx] " Zhenyu Wang
2014-06-25  2:28   ` Chen, Tiejun
2014-06-25  2:28     ` Chen, Tiejun
2014-06-25  2:28     ` [Qemu-devel] [Intel-gfx] " Chen, Tiejun
2014-07-07 14:51     ` Daniel Vetter
2014-07-07 14:51       ` Daniel Vetter
2014-07-07 14:51       ` [Qemu-devel] " Daniel Vetter
2014-06-30 11:18 ` Michael S. Tsirkin
2014-06-30 11:18   ` Michael S. Tsirkin
2014-06-30 11:18   ` [Qemu-devel] " Michael S. Tsirkin
2014-07-01  1:52   ` Chen, Tiejun
2014-07-01  1:52     ` Chen, Tiejun
2014-07-01  1:52     ` [Qemu-devel] " Chen, Tiejun
2014-07-02  6:21 ` Michael S. Tsirkin
2014-07-02  6:21   ` Michael S. Tsirkin
2014-07-02  6:21   ` [Qemu-devel] " Michael S. Tsirkin
2014-07-02  8:27   ` Chen, Tiejun
2014-07-02  8:27     ` Chen, Tiejun
2014-07-02  8:27     ` [Qemu-devel] " Chen, Tiejun

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.