Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5fe49d86 authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915: Only bind to function 0 of the PCI device



Early chipsets (gen2/3) used function 1 as a placeholder for multi-head.
We used to ignore these since they were not assigned to
PCI_CLASS_DISPLAY_VGA. However with 934f992c we attempt to bind to all
Intel PCI_CLASS_DISPLAY devices (and functions) to work in multi-gpu
systems. This fails hard on gen2/3.

Reported-by: default avatarFerenc Wágner <wferi@niif.hu>
Tested-by: default avatarFerenc Wágner <wferi@niif.hu>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=28012


Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
parent 78c6e170
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -568,6 +568,14 @@ int i915_reset(struct drm_device *dev, u8 flags)
static int __devinit
static int __devinit
i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
{
	/* Only bind to function 0 of the device. Early generations
	 * used function 1 as a placeholder for multi-head. This causes
	 * us confusion instead, especially on the systems where both
	 * functions have the same PCI-ID!
	 */
	if (PCI_FUNC(pdev->devfn))
		return -ENODEV;

	return drm_get_pci_dev(pdev, ent, &driver);
	return drm_get_pci_dev(pdev, ent, &driver);
}
}