aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/vt.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2010-06-23 15:56:12 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 16:47:40 -0400
commit8fd4bd22350784d5b2fe9274f6790ba353976415 (patch)
treea74d39c50f9a1ca74cfb47b08201c3a3d1e0baea /drivers/char/vt.c
parent26df6d13406d1a53b0bda08bd712f1924affd7cd (diff)
vt/console: try harder to print output when panicing
Jesse's initial patch commit said: "At panic time (i.e. when oops_in_progress is set) we should try a bit harder to update the screen and make sure output gets to the VT, since some drivers are capable of flipping back to it. So make sure we try to unblank and update the display if called from a panic context." I've enhanced this to add a flag to the vc that console layer can set to indicate they want this behaviour to occur. This also adds support to fbcon for that flag and adds an fb flag for drivers to indicate they want to use the support. It enables this for KMS drivers. Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Acked-by: James Simmons <jsimmons@infradead.org> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char/vt.c')
-rw-r--r--drivers/char/vt.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 34bfb056d7a..82f64ac2119 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -705,7 +705,10 @@ void redraw_screen(struct vc_data *vc, int is_switch)
705 update_attr(vc); 705 update_attr(vc);
706 clear_buffer_attributes(vc); 706 clear_buffer_attributes(vc);
707 } 707 }
708 if (update && vc->vc_mode != KD_GRAPHICS) 708
709 /* Forcibly update if we're panicing */
710 if ((update && vc->vc_mode != KD_GRAPHICS) ||
711 vt_force_oops_output(vc))
709 do_update_region(vc, vc->vc_origin, vc->vc_screenbuf_size / 2); 712 do_update_region(vc, vc->vc_origin, vc->vc_screenbuf_size / 2);
710 } 713 }
711 set_cursor(vc); 714 set_cursor(vc);
@@ -743,6 +746,7 @@ static void visual_init(struct vc_data *vc, int num, int init)
743 vc->vc_hi_font_mask = 0; 746 vc->vc_hi_font_mask = 0;
744 vc->vc_complement_mask = 0; 747 vc->vc_complement_mask = 0;
745 vc->vc_can_do_color = 0; 748 vc->vc_can_do_color = 0;
749 vc->vc_panic_force_write = false;
746 vc->vc_sw->con_init(vc, init); 750 vc->vc_sw->con_init(vc, init);
747 if (!vc->vc_complement_mask) 751 if (!vc->vc_complement_mask)
748 vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800; 752 vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;
@@ -2506,7 +2510,7 @@ static void vt_console_print(struct console *co, const char *b, unsigned count)
2506 goto quit; 2510 goto quit;
2507 } 2511 }
2508 2512
2509 if (vc->vc_mode != KD_TEXT) 2513 if (vc->vc_mode != KD_TEXT && !vt_force_oops_output(vc))
2510 goto quit; 2514 goto quit;
2511 2515
2512 /* undraw cursor first */ 2516 /* undraw cursor first */
@@ -3784,7 +3788,8 @@ void do_unblank_screen(int leaving_gfx)
3784 return; 3788 return;
3785 } 3789 }
3786 vc = vc_cons[fg_console].d; 3790 vc = vc_cons[fg_console].d;
3787 if (vc->vc_mode != KD_TEXT) 3791 /* Try to unblank in oops case too */
3792 if (vc->vc_mode != KD_TEXT && !vt_force_oops_output(vc))
3788 return; /* but leave console_blanked != 0 */ 3793 return; /* but leave console_blanked != 0 */
3789 3794
3790 if (blankinterval) { 3795 if (blankinterval) {
@@ -3793,7 +3798,7 @@ void do_unblank_screen(int leaving_gfx)
3793 } 3798 }
3794 3799
3795 console_blanked = 0; 3800 console_blanked = 0;
3796 if (vc->vc_sw->con_blank(vc, 0, leaving_gfx)) 3801 if (vc->vc_sw->con_blank(vc, 0, leaving_gfx) || vt_force_oops_output(vc))
3797 /* Low-level driver cannot restore -> do it ourselves */ 3802 /* Low-level driver cannot restore -> do it ourselves */
3798 update_screen(vc); 3803 update_screen(vc);
3799 if (console_blank_hook) 3804 if (console_blank_hook)