From d82292c9fde0bd5ad04816096be3c4337660d4c7 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Wed, 23 Jul 2014 16:38:27 -0400 Subject: [PATCH 2/3] i915/drm/xen: Use subsystem_vendor and model instead of bridge to figure type. Instead of trying to figure out what type of i915 GPU it is based on the bridge we will use the subsystem_device if it is virtualized. The other benefit of this patch is that for baremetal we can now remove the scanning of the bridge and just use the GPU's PCI device to scan if we would like. Signed-off-by: Konrad Rzeszutek Wilk --- drivers/gpu/drm/i915/i915_drv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 404273b..11b6dc1 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -411,6 +411,9 @@ static int set_pch_type(struct pci_dev *pch, struct drm_i915_private *dev_priv) if (pch->vendor != PCI_VENDOR_ID_INTEL) return 0; + if (pch->subsystem_vendor == PCI_VENDOR_ID_XEN) + id = pch->subsystem_device & INTEL_PCH_DEVICE_ID_MASK; + dev_priv->pch_id = id; if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) { @@ -478,6 +481,14 @@ void intel_detect_pch(struct drm_device *dev) if (ok) break; } + if (!ok) { + /* + * Try the GPU in case it is virtualized and we want to use + * the subsystem vendor id instead of the bridge to match. + */ + pch = dev->pdev; + ok = set_pch_type(pch, dev_priv); + } if (!ok) DRM_DEBUG_KMS("No PCH found.\n"); } -- 1.9.3