]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
fb: add support for drivers not needing VT switch at suspend/resume time
authorJesse Barnes <jbarnes@virtuousgeek.org>
Mon, 4 Feb 2013 13:37:21 +0000 (13:37 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 20 Feb 2013 00:33:41 +0000 (01:33 +0100)
Use the new PM routines to indicate whether we need to VT switch at suspend
and resume time.  When a new driver is bound, set its flag accordingly,
and when unbound, remove it from the PM's console tracking list.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/video/fbmem.c
include/linux/fb.h

index dc61c12ecf8ca516e7910fc5156e81e9701bb788..2af7153da2e412b791a003b57bf875fe249a850b 100644 (file)
@@ -1645,6 +1645,11 @@ static int do_register_framebuffer(struct fb_info *fb_info)
        if (!fb_info->modelist.prev || !fb_info->modelist.next)
                INIT_LIST_HEAD(&fb_info->modelist);
 
+       if (fb_info->skip_vt_switch)
+               pm_vt_switch_required(fb_info->dev, false);
+       else
+               pm_vt_switch_required(fb_info->dev, true);
+
        fb_var_to_videomode(&mode, &fb_info->var);
        fb_add_videomode(&mode, &fb_info->modelist);
        registered_fb[i] = fb_info;
@@ -1679,6 +1684,8 @@ static int do_unregister_framebuffer(struct fb_info *fb_info)
        if (ret)
                return -EINVAL;
 
+       pm_vt_switch_unregister(fb_info->dev);
+
        unlink_framebuffer(fb_info);
        if (fb_info->pixmap.addr &&
            (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT))
index 58b98606ac266fa86fdfe3a63c42b235a984e7b8..d49c60f5aa4c52250e5e5c9549ccb4fdf105d3ce 100644 (file)
@@ -501,6 +501,8 @@ struct fb_info {
                        resource_size_t size;
                } ranges[0];
        } *apertures;
+
+       bool skip_vt_switch; /* no VT switch on suspend/resume required */
 };
 
 static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {