mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
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>
This commit is contained in:
parent
42eddbd7b2
commit
2f3787aa43
1 changed files with 2 additions and 1 deletions
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue