From 82648190aad4500df8699ded8086e1f41e429b8a Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 15 Aug 2012 14:35:40 +0200 Subject: [PATCH] Detect 3D controllers as gfx device too Necessary for Lenovo G580 for example. --- acpi-handle-hack.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/acpi-handle-hack.c b/acpi-handle-hack.c index daa9926..21ab242 100644 --- a/acpi-handle-hack.c +++ b/acpi-handle-hack.c @@ -32,8 +32,13 @@ static bool __init need_acpi_handle_hack(void) { static struct pci_dev __init *get_discrete_device(void) { struct pci_dev *pdev = NULL; - int class = PCI_CLASS_DISPLAY_VGA << 8; - while ((pdev = pci_get_class(class, pdev)) != NULL) { + while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { + int pci_class = pdev->class >> 8; + + if (pci_class != PCI_CLASS_DISPLAY_VGA && + pci_class != PCI_CLASS_DISPLAY_3D) + continue; + if (pdev->vendor != PCI_VENDOR_ID_INTEL) { return pdev; }