From a904b442af1bc31c1f96f610c727f1d3ff7b940f Mon Sep 17 00:00:00 2001 From: Lekensteyn Date: Sun, 15 Jan 2012 10:43:44 +0100 Subject: [PATCH 1/3] Add debug message in case no ACPI handle is found --- bbswitch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bbswitch.c b/bbswitch.c index 7d69dee..9ad81de 100644 --- a/bbswitch.c +++ b/bbswitch.c @@ -336,8 +336,11 @@ static int __init bbswitch_init(void) { acpi_handle handle; handle = DEVICE_ACPI_HANDLE(&pdev->dev); - if (!handle) + if (!handle) { + printk(KERN_WARNING "bbswitch: cannot find ACPI handle for VGA" + " device %s\n", dev_name(&pdev->dev)); continue; + } acpi_get_name(handle, ACPI_FULL_PATHNAME, &buf); From ebf86f061761325d2ab4c2233d62645d7c91dad4 Mon Sep 17 00:00:00 2001 From: Lekensteyn Date: Sun, 15 Jan 2012 16:35:07 +0100 Subject: [PATCH 2/3] Detect 3D controllers as gfx device too (GH-3) --- bbswitch.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bbswitch.c b/bbswitch.c index 9ad81de..199229d 100644 --- a/bbswitch.c +++ b/bbswitch.c @@ -329,11 +329,15 @@ static int __init bbswitch_init(void) { struct proc_dir_entry *acpi_entry; struct pci_dev *pdev = NULL; acpi_handle igd_handle = 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) { struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL }; acpi_handle handle; + int pci_class = pdev->class >> 8; + + if (pci_class != PCI_CLASS_DISPLAY_VGA && + pci_class != PCI_CLASS_DISPLAY_3D) + continue; handle = DEVICE_ACPI_HANDLE(&pdev->dev); if (!handle) { From 8bd07d14af8fe9a1baab1d2fd3f1bd7df4e8dd9f Mon Sep 17 00:00:00 2001 From: Lekensteyn Date: Sun, 15 Jan 2012 17:18:14 +0100 Subject: [PATCH 3/3] Bump to version 0.4, update NEWS --- NEWS | 5 +++++ bbswitch.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 1d1c033..4cfec07 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +Version 0.4 - 15 January 2012 + +* Support for models that have a "3D controller" instead of "VGA compatible + controller". + Version 0.3 - 14 January 2012 * Support for models that have the nvidia DSM method on the integrated Intel diff --git a/bbswitch.c b/bbswitch.c index 199229d..1c1d0be 100644 --- a/bbswitch.c +++ b/bbswitch.c @@ -19,7 +19,7 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Toggle the discrete graphics card"); MODULE_AUTHOR("Peter Lekensteyn "); -MODULE_VERSION("0.3"); +MODULE_VERSION("0.4"); enum { CARD_UNCHANGED = -1,