summaryrefslogtreecommitdiff
path: root/drivers/gpu/vga/vga_switcheroo.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@gmail.com>2013-01-25 05:38:56 +0400
committerDave Airlie <airlied@redhat.com>2013-02-08 06:02:43 +0400
commit054430e773c9a1e26f38e30156eff02dedfffc17 (patch)
tree9866f12c399f63de3ac285624226b19c0501b191 /drivers/gpu/vga/vga_switcheroo.c
parente93a9a868792ad71cdd09d75e5a02d8067473c4e (diff)
downloadlinux-054430e773c9a1e26f38e30156eff02dedfffc17.tar.xz
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 <maarten.lankhorst@canonical.com> Tested-by: Lu Hua <huax.lu@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/vga/vga_switcheroo.c')
-rw-r--r--drivers/gpu/vga/vga_switcheroo.c3
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();
event.info = new_client->fb_info;
fb_notifier_call_chain(FB_EVENT_REMAP_ALL_CONSOLE, &event);
+ console_unlock();
}
ret = vgasr_priv.handler->switchto(new_client->id);