path: root/drivers/gpu/vga/vga_switcheroo.c
diff options
authorDave Airlie <>2013-01-25 11:38:56 +1000
committerDave Airlie <>2013-02-08 12:02:43 +1000
commit054430e773c9a1e26f38e30156eff02dedfffc17 (patch)
tree9866f12c399f63de3ac285624226b19c0501b191 /drivers/gpu/vga/vga_switcheroo.c
parente93a9a868792ad71cdd09d75e5a02d8067473c4e (diff)
fbcon: fix locking harder
Okay so Alan's patch handled the case where there was no registered fbcon, however the other path entered in set_con2fb_map pit. In there we called fbcon_takeover, but we also took the console lock in a couple of places. So push the console lock out to the callers of set_con2fb_map, this means fbmem and switcheroo needed to take the lock around the fb notifier entry points that lead to this. This should fix the efifb regression seen by Maarten. Tested-by: Maarten Lankhorst <> Tested-by: Lu Hua <> Signed-off-by: Dave Airlie <>
Diffstat (limited to 'drivers/gpu/vga/vga_switcheroo.c')
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index fa60add0ff63..cf787e1d9322 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -25,6 +25,7 @@
#include <linux/fb.h>
#include <linux/pci.h>
+#include <linux/console.h>
#include <linux/vga_switcheroo.h>
#include <linux/vgaarb.h>
@@ -337,8 +338,10 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client)
if (new_client->fb_info) {
struct fb_event event;
+ console_lock(); = new_client->fb_info;
fb_notifier_call_chain(FB_EVENT_REMAP_ALL_CONSOLE, &event);
+ console_unlock();
ret = vgasr_priv.handler->switchto(new_client->id);