summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_acpi.c
diff options
context:
space:
mode:
authorAndreas Heider <andreas@meetr.de>2012-05-21 00:14:50 +0100
committerBen Skeggs <bskeggs@redhat.com>2012-05-24 16:56:34 +1000
commit2f3787aa439ae0d34e4658400c1139a7541bec1d (patch)
treeb0465658f2a4593eea40af2d1865917490b5d432 /drivers/gpu/drm/nouveau/nouveau_acpi.c
parent42eddbd7b2b5cc9bbb4c918a3294b6ee9dd53c59 (diff)
downloadtalos-op-linux-2f3787aa439ae0d34e4658400c1139a7541bec1d.tar.gz
talos-op-linux-2f3787aa439ae0d34e4658400c1139a7541bec1d.zip
drm/nouveau: Check dsm on switcheroo unregister
Currently vga_switcheroo_unregister_handler is called unconditionally when nouveau is unloaded, even when nouveau never registered a handler. This interferes with other switcheroo handlers, as vga_switcheroo doesn't check who called unregister_handler, but simply unregisters the current handler. This patch adds a check so unregister is only called if a handler was registered by nouveau before. Signed-off-by: Andreas Heider <andreas@meetr.de> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_acpi.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_acpi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index 284bd25d5d21..fc841e87b343 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -338,7 +338,8 @@ void nouveau_switcheroo_optimus_dsm(void)
void nouveau_unregister_dsm_handler(void)
{
- vga_switcheroo_unregister_handler();
+ if (nouveau_dsm_priv.optimus_detected || nouveau_dsm_priv.dsm_detected)
+ vga_switcheroo_unregister_handler();
}
/* retrieve the ROM in 4k blocks */
OpenPOWER on IntegriCloud