1 Commits
v0.4.1 ... v0.3

Author SHA1 Message Date
fd4dabf37e Merge branch 'develop' 2012-01-14 23:18:54 +01:00
2 changed files with 5 additions and 22 deletions

10
NEWS
View File

@ -1,13 +1,3 @@
Version 0.4.1 - 16 January 2012
* Corrected a small error that yielded an confusing error message "The discrete
card could not be enabled by a _DSM call"
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 Version 0.3 - 14 January 2012
* Support for models that have the nvidia DSM method on the integrated Intel * Support for models that have the nvidia DSM method on the integrated Intel

View File

@ -19,7 +19,7 @@
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Toggle the discrete graphics card"); MODULE_DESCRIPTION("Toggle the discrete graphics card");
MODULE_AUTHOR("Peter Lekensteyn <lekensteyn@gmail.com>"); MODULE_AUTHOR("Peter Lekensteyn <lekensteyn@gmail.com>");
MODULE_VERSION("0.4.1"); MODULE_VERSION("0.3");
enum { enum {
CARD_UNCHANGED = -1, CARD_UNCHANGED = -1,
@ -190,7 +190,7 @@ static int bbswitch_acpi_on(void) {
char args[] = {1, 0, 0, 0}; char args[] = {1, 0, 0, 0};
u32 result = 0; u32 result = 0;
if (acpi_call_dsm(dis_handle, acpi_nvidia_dsm_muid, 0x102, 0x3, args, if (!acpi_call_dsm(dis_handle, acpi_nvidia_dsm_muid, 0x102, 0x3, args,
&result)) { &result)) {
// failure // failure
return 1; return 1;
@ -329,22 +329,15 @@ static int __init bbswitch_init(void) {
struct proc_dir_entry *acpi_entry; struct proc_dir_entry *acpi_entry;
struct pci_dev *pdev = NULL; struct pci_dev *pdev = NULL;
acpi_handle igd_handle = NULL; acpi_handle igd_handle = NULL;
int class = PCI_CLASS_DISPLAY_VGA << 8;
while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { while ((pdev = pci_get_class(class, pdev)) != NULL) {
struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL };
acpi_handle handle; 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); 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; continue;
}
acpi_get_name(handle, ACPI_FULL_PATHNAME, &buf); acpi_get_name(handle, ACPI_FULL_PATHNAME, &buf);