diff options
Diffstat (limited to 'drivers/video/fbdev/core/fbmem.c')
| -rw-r--r-- | drivers/video/fbdev/core/fbmem.c | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 30f2b59c47bf..2f1c56e5a7a2 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -14,13 +14,13 @@ #include <linux/console.h> #include <linux/export.h> #include <linux/fb.h> -#include <linux/fbcon.h> #include <linux/lcd.h> #include <linux/leds.h> #include <video/nomodeset.h> #include "fb_internal.h" +#include "fbcon.h" /* * Frame buffer device initialization and setup routines @@ -346,6 +346,19 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) } EXPORT_SYMBOL(fb_set_var); +int fb_set_var_from_user(struct fb_info *info, struct fb_var_screeninfo *var) +{ + int ret = fbcon_modechange_possible(info, var); + + if (!ret) + ret = fb_set_var(info, var); + if (!ret) + fbcon_update_vcs(info, var->activate & FB_ACTIVATE_ALL); + + return ret; +} +EXPORT_SYMBOL(fb_set_var_from_user); + static void fb_lcd_notify_blank(struct fb_info *info) { int power; @@ -409,6 +422,16 @@ err: } EXPORT_SYMBOL(fb_blank); +int fb_blank_from_user(struct fb_info *info, int blank) +{ + int ret = fb_blank(info, blank); + + /* might again call into fb_blank */ + fbcon_fb_blanked(info, blank); + + return ret; +} + static int fb_check_foreignness(struct fb_info *fi) { const bool foreign_endian = fi->flags & FBINFO_FOREIGN_ENDIAN; @@ -661,6 +684,16 @@ void fb_set_suspend(struct fb_info *info, int state) } EXPORT_SYMBOL(fb_set_suspend); +/** + * fb_switch_outputs - framebuffer got the outputs from vga-switcheroo + * @info: framebuffer + */ +void fb_switch_outputs(struct fb_info *info) +{ + fbcon_remap_all(info); +} +EXPORT_SYMBOL(fb_switch_outputs); + static int __init fbmem_init(void) { int ret; @@ -734,6 +767,18 @@ int fb_new_modelist(struct fb_info *info) if (list_empty(&info->modelist)) return 1; + /* + * The new modelist may not contain the current mode (info->var), and + * fbcon_new_modelist() below only re-points consoles mapped to this + * framebuffer. Add the current mode here so info->var keeps a match + * even when fbcon is unbound. + */ + if (!fb_match_mode(&info->var, &info->modelist)) { + fb_var_to_videomode(&mode, &info->var); + if (fb_add_videomode(&mode, &info->modelist)) + return 1; + } + fbcon_new_modelist(info); return 0; |
