Commit e614b18d authored by Antonino A. Daplas's avatar Antonino A. Daplas Committed by Linus Torvalds

[PATCH] VT binding: Update fbcon to support binding

The control for binding/unbinding is moved from fbcon to the console layer.
Thus the fbcon sysfs attributes, attach and detach, are also gone.

    1. Add a notifier event that tells fbcon if a framebuffer driver has been
       unregistered.  If no registered driver remains, fbcon will unregister
       itself from the console layer.

    2. Replaced calls to give_up_console() with unregister_con_driver().

    3. Still use take_over_console() instead of register_con_driver() to
       maintain compatibility

    4. Respect the parameter first_fb_vc and last_fb_vc instead of using 0 and
       MAX_NR_CONSOLES - 1. These parameters are settable by the user.

    5. When fbcon is completely unbound from the console layer, fbcon will
       also release (iow, decrement module reference counts to zero) all fbdev
       drivers. In other words, a bind or unbind request from the console layer
       will propagate down to the framebuffer drivers.

    6. If fbcon is not bound to the console, it will ignore all notifier
       events (except driver registration and unregistration) and all sysfs
       requests.
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3e795de7
This diff is collapsed.
...@@ -1353,6 +1353,7 @@ register_framebuffer(struct fb_info *fb_info) ...@@ -1353,6 +1353,7 @@ register_framebuffer(struct fb_info *fb_info)
int int
unregister_framebuffer(struct fb_info *fb_info) unregister_framebuffer(struct fb_info *fb_info)
{ {
struct fb_event event;
int i; int i;
i = fb_info->node; i = fb_info->node;
...@@ -1360,13 +1361,17 @@ unregister_framebuffer(struct fb_info *fb_info) ...@@ -1360,13 +1361,17 @@ unregister_framebuffer(struct fb_info *fb_info)
return -EINVAL; return -EINVAL;
devfs_remove("fb/%d", i); devfs_remove("fb/%d", i);
if (fb_info->pixmap.addr && (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT)) if (fb_info->pixmap.addr &&
(fb_info->pixmap.flags & FB_PIXMAP_DEFAULT))
kfree(fb_info->pixmap.addr); kfree(fb_info->pixmap.addr);
fb_destroy_modelist(&fb_info->modelist); fb_destroy_modelist(&fb_info->modelist);
registered_fb[i]=NULL; registered_fb[i]=NULL;
num_registered_fb--; num_registered_fb--;
fb_cleanup_class_device(fb_info); fb_cleanup_class_device(fb_info);
class_device_destroy(fb_class, MKDEV(FB_MAJOR, i)); class_device_destroy(fb_class, MKDEV(FB_MAJOR, i));
event.info = fb_info;
blocking_notifier_call_chain(&fb_notifier_list,
FB_EVENT_FB_UNREGISTERED, &event);
return 0; return 0;
} }
......
...@@ -504,17 +504,19 @@ struct fb_cursor_user { ...@@ -504,17 +504,19 @@ struct fb_cursor_user {
#define FB_EVENT_MODE_DELETE 0x04 #define FB_EVENT_MODE_DELETE 0x04
/* A driver registered itself */ /* A driver registered itself */
#define FB_EVENT_FB_REGISTERED 0x05 #define FB_EVENT_FB_REGISTERED 0x05
/* A driver unregistered itself */
#define FB_EVENT_FB_UNREGISTERED 0x06
/* CONSOLE-SPECIFIC: get console to framebuffer mapping */ /* CONSOLE-SPECIFIC: get console to framebuffer mapping */
#define FB_EVENT_GET_CONSOLE_MAP 0x06 #define FB_EVENT_GET_CONSOLE_MAP 0x07
/* CONSOLE-SPECIFIC: set console to framebuffer mapping */ /* CONSOLE-SPECIFIC: set console to framebuffer mapping */
#define FB_EVENT_SET_CONSOLE_MAP 0x07 #define FB_EVENT_SET_CONSOLE_MAP 0x08
/* A display blank is requested */ /* A display blank is requested */
#define FB_EVENT_BLANK 0x08 #define FB_EVENT_BLANK 0x09
/* Private modelist is to be replaced */ /* Private modelist is to be replaced */
#define FB_EVENT_NEW_MODELIST 0x09 #define FB_EVENT_NEW_MODELIST 0x0A
/* The resolution of the passed in fb_info about to change and /* The resolution of the passed in fb_info about to change and
all vc's should be changed */ all vc's should be changed */
#define FB_EVENT_MODE_CHANGE_ALL 0x0A #define FB_EVENT_MODE_CHANGE_ALL 0x0B
struct fb_event { struct fb_event {
struct fb_info *info; struct fb_info *info;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment