Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] fbdev: Add fbset -a support

Add capability to fbdev to listen to the FB_ACTIVATE_ALL flag. If set, it
notifies fbcon that all consoles must be set to the current var.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Antonino A. Daplas and committed by
Linus Torvalds
7726e9e1 cb2e87a6

+55 -2
+48
drivers/video/console/fbcon.c
··· 2593 2593 } 2594 2594 } 2595 2595 2596 + static void fbcon_set_all_vcs(struct fb_info *info) 2597 + { 2598 + struct fbcon_ops *ops = info->fbcon_par; 2599 + struct vc_data *vc; 2600 + struct display *p; 2601 + int i, rows, cols; 2602 + 2603 + if (!ops || ops->currcon < 0) 2604 + return; 2605 + 2606 + for (i = 0; i < MAX_NR_CONSOLES; i++) { 2607 + vc = vc_cons[i].d; 2608 + if (!vc || vc->vc_mode != KD_TEXT || 2609 + registered_fb[con2fb_map[i]] != info) 2610 + continue; 2611 + 2612 + p = &fb_display[vc->vc_num]; 2613 + 2614 + info->var.xoffset = info->var.yoffset = p->yscroll = 0; 2615 + var_to_display(p, &info->var, info); 2616 + cols = info->var.xres / vc->vc_font.width; 2617 + rows = info->var.yres / vc->vc_font.height; 2618 + vc_resize(vc, cols, rows); 2619 + 2620 + if (CON_IS_VISIBLE(vc)) { 2621 + updatescrollmode(p, info, vc); 2622 + scrollback_max = 0; 2623 + scrollback_current = 0; 2624 + update_var(vc->vc_num, info); 2625 + fbcon_set_palette(vc, color_table); 2626 + update_screen(vc); 2627 + if (softback_buf) { 2628 + int l = fbcon_softback_size / vc->vc_size_row; 2629 + if (l > 5) 2630 + softback_end = softback_buf + l * vc->vc_size_row; 2631 + else { 2632 + /* Smaller scrollback makes no sense, and 0 2633 + would screw the operation totally */ 2634 + softback_top = 0; 2635 + } 2636 + } 2637 + } 2638 + } 2639 + } 2640 + 2596 2641 static int fbcon_mode_deleted(struct fb_info *info, 2597 2642 struct fb_videomode *mode) 2598 2643 { ··· 2752 2707 break; 2753 2708 case FB_EVENT_MODE_CHANGE: 2754 2709 fbcon_modechanged(info); 2710 + break; 2711 + case FB_EVENT_MODE_CHANGE_ALL: 2712 + fbcon_set_all_vcs(info); 2755 2713 break; 2756 2714 case FB_EVENT_MODE_DELETE: 2757 2715 mode = event->data;
+4 -2
drivers/video/fbmem.c
··· 684 684 685 685 if (!err && (flags & FBINFO_MISC_USEREVENT)) { 686 686 struct fb_event event; 687 + int evnt = (var->activate & FB_ACTIVATE_ALL) ? 688 + FB_EVENT_MODE_CHANGE_ALL : 689 + FB_EVENT_MODE_CHANGE; 687 690 688 691 info->flags &= ~FBINFO_MISC_USEREVENT; 689 692 event.info = info; 690 - notifier_call_chain(&fb_notifier_list, 691 - FB_EVENT_MODE_CHANGE, 693 + notifier_call_chain(&fb_notifier_list, evnt, 692 694 &event); 693 695 } 694 696 }
+3
include/linux/fb.h
··· 495 495 #define FB_EVENT_BLANK 0x08 496 496 /* Private modelist is to be replaced */ 497 497 #define FB_EVENT_NEW_MODELIST 0x09 498 + /* The resolution of the passed in fb_info about to change and 499 + all vc's should be changed */ 500 + #define FB_EVENT_MODE_CHANGE_ALL 0x0A 498 501 499 502 struct fb_event { 500 503 struct fb_info *info;