vt: Delay the update of the visible framebuffer console
Subsystems (2)
PATCH 1/1 vt: Delay the update of the visible framebuffer console
This is a patch that delays updating the visible framebuffer console until the other consoles have been initialized in order to avoid losing output lines. This problem was discovered when loading a framebuffer driver as a module. Comments welcome.
Jordan
[PATCH] vt: Delay the update of the visible framebuffer console
From: David Hollister <[email protected]>
This patch delays the update of the visible framebuffer console until all other consoles have been initialized in order to avoid losing information. This only seems to be a problem with modules, not with built-in drivers.
---
drivers/char/vt.c | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-)
drivers/char/vt.c +14 -8
@@ -2700,9 +2700,11 @@ int take_over_console(const struct conswif (!vc || !vc->vc_sw)continue ; - j = i; -if (CON_IS_VISIBLE (vc)) +if (CON_IS_VISIBLE (vc)) { + j = i;save_screen (vc); + } + old_was_color = vc->vc_can_do_color; vc->vc_sw->con_deinit (vc); vc->vc_origin = (unsigned long )vc->vc_screenbuf;
@@ -2718,17 +2720,21 @@ int take_over_console(const struct consw*/ if (old_was_color != vc->vc_can_do_color)clear_buffer_attributes (vc); - -if (CON_IS_VISIBLE (vc)) -update_screen (vc); } +printk ("Console: switching " );if (!deflt)printk ("consoles %d-%d " , first+1 , last+1 ); -if (j >=0 ) +if (j >=0 ) { +struct vc_data *vc = vc_cons[j].d; +printk ("to %s %s %dx%d\n" , - vc_cons[j].d->vc_can_do_color ?"colour" :"mono" , - desc, vc_cons[j].d->vc_cols, vc_cons[j].d->vc_rows); + vc->vc_can_do_color ?"colour" :"mono" , + desc, vc->vc_cols, vc->vc_rows); + +if (CON_IS_VISIBLE (vc)) +update_screen (vc); + }else printk ("to %s\n" , desc);
Quoted 10 lines · Jordan Crouse
This is a patch that delays updating the visible framebuffer console until the other consoles have been initialized in order to avoid losing output lines. This problem was discovered when loading a framebuffer driver as a module. Comments welcome.
Jordan
------------------------------------------------------------------------
Quoted 8 lines
[PATCH] vt: Delay the update of the visible framebuffer console
From: David Hollister <[email protected]>
This patch delays the update of the visible framebuffer console until all other consoles have been initialized in order to avoid losing information. This only seems to be a problem with modules, not with built-in drivers.
Looks okay except for one point...
Quoted 43 lines
Signed-off-by David Hollister <[email protected]>Signed-off-by Jordan Crouse <[email protected]>---
drivers/char/vt.c | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-)drivers/char/vt.c +8
-6@@ -2700,9 +2700,11 @@ int take_over_console(const struct conswif (!vc || !vc->vc_sw)continue ; - j = i; -if (CON_IS_VISIBLE (vc)) +if (CON_IS_VISIBLE (vc)) { + j = i;save_screen (vc); + } + old_was_color = vc->vc_can_do_color; vc->vc_sw->con_deinit (vc); vc->vc_origin = (unsigned long )vc->vc_screenbuf;@@ -2718,17 +2720,21 @@ int take_over_console(const struct consw*/ if (old_was_color != vc->vc_can_do_color)clear_buffer_attributes (vc); - -if (CON_IS_VISIBLE (vc)) -update_screen (vc); } +printk ("Console: switching " );if (!deflt)printk ("consoles %d-%d " , first+1 , last+1 ); -if (j >=0 ) +if (j >=0 ) { +struct vc_data *vc = vc_cons[j].d; + printk("to %s %s %dx%d\n",
drivers/char/vt.c int take_over_console(const struct consw · line 2739
Quoted 10 lines
drivers/char/vt.c +6
-2- vc_cons[j].d->vc_can_do_color ?"colour" :"mono" , - desc, vc_cons[j].d->vc_cols, vc_cons[j].d->vc_rows); + vc->vc_can_do_color ?"colour" :"mono" , + desc, vc->vc_cols, vc->vc_rows); + +if (CON_IS_VISIBLE (vc)) +update_screen (vc); + }else printk ("to %s\n" , desc);
If take_over_console() is called with parameter first = 0, last = 4, and the visible console = 5, you get here instead...
Tony