Commit 2f3787aa authored by Andreas Heider's avatar Andreas Heider Committed by Ben Skeggs

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: default avatarAndreas Heider <andreas@meetr.de>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 42eddbd7
......@@ -338,6 +338,7 @@ void nouveau_switcheroo_optimus_dsm(void)
void nouveau_unregister_dsm_handler(void)
{
if (nouveau_dsm_priv.optimus_detected || nouveau_dsm_priv.dsm_detected)
vga_switcheroo_unregister_handler();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment