From fc2f2aa9c711ebad3f7205cbc8e59313914e4576 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 30 Jan 2013 18:20:08 +0100 Subject: [PATCH] Add option to disable Optimus DSM (GH-14) Necessary for one (some?) older laptops like the Lenovo T410s. Usage: put "options bbswitch skip_optimus_dsm=1" in your modprobe.conf --- bbswitch.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bbswitch.c b/bbswitch.c index 5420d44..d839fa7 100644 --- a/bbswitch.c +++ b/bbswitch.c @@ -38,6 +38,9 @@ module_param(load_state, int, 0400); static int unload_state = CARD_UNCHANGED; MODULE_PARM_DESC(unload_state, "Card state on unload (0 = off, 1 = on, -1 = unchanged)"); module_param(unload_state, int, 0600); +static bool skip_optimus_dsm = false; +MODULE_PARM_DESC(skip_optimus_dsm, "Skip probe of Optimus discrete DSM (default = false)"); +module_param(skip_optimus_dsm, bool, 0400); extern struct proc_dir_entry *acpi_root_dir; @@ -387,7 +390,8 @@ static int __init bbswitch_init(void) { return -ENODEV; } - if (has_dsm_func(acpi_optimus_dsm_muid, 0x100, 0x1A)) { + if (!skip_optimus_dsm && + has_dsm_func(acpi_optimus_dsm_muid, 0x100, 0x1A)) { dsm_type = DSM_TYPE_OPTIMUS; pr_info("detected an Optimus _DSM function\n"); } else if (has_dsm_func(acpi_nvidia_dsm_muid, 0x102, 0x3)) {