vga_switcheroo: Remove assumptions about registration/unregistration ordering
authorSeth Forshee <seth.forshee@canonical.com>
Fri, 17 Aug 2012 16:17:03 +0000 (11:17 -0500)
committerMatthew Garrett <mjg@redhat.com>
Fri, 17 Aug 2012 21:34:41 +0000 (17:34 -0400)
commit36704c0c4c64f889d77158d497f6a7e596d1341c
tree540dbed65a418bb599a729a17aa8cc806a1042af
parent76b487dd5187a4d7cc6eccd452f65467a8c7768b
vga_switcheroo: Remove assumptions about registration/unregistration ordering

vga_switcheroo assumes that the handler will be registered before the
last client, otherwise switching will not be enabled. Likewise it's
assumed that the handler will not be unregistered without at least one
client also being unregistered, otherwise switching will remain enabled
despite no longer having a handler. These assumptions cannot be enforced
if the handler is in a separate driver from both clients, as with the
gmux found in Apple laptops. Remove this assumption.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
drivers/gpu/vga/vga_switcheroo.c