diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-06-23 15:56:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 16:47:40 -0400 |
commit | 8fd4bd22350784d5b2fe9274f6790ba353976415 (patch) | |
tree | a74d39c50f9a1ca74cfb47b08201c3a3d1e0baea /include/linux | |
parent | 26df6d13406d1a53b0bda08bd712f1924affd7cd (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 'include/linux')
-rw-r--r-- | include/linux/console_struct.h | 1 | ||||
-rw-r--r-- | include/linux/fb.h | 4 | ||||
-rw-r--r-- | include/linux/vt_kern.h | 7 |
3 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index 38fe59dc89ae..d7d9acdccffb 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h | |||
@@ -105,6 +105,7 @@ struct vc_data { | |||
105 | struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */ | 105 | struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */ |
106 | unsigned long vc_uni_pagedir; | 106 | unsigned long vc_uni_pagedir; |
107 | unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */ | 107 | unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */ |
108 | bool vc_panic_force_write; /* when oops/panic this VC can accept forced output/blanking */ | ||
108 | /* additional information is in vt_kern.h */ | 109 | /* additional information is in vt_kern.h */ |
109 | }; | 110 | }; |
110 | 111 | ||
diff --git a/include/linux/fb.h b/include/linux/fb.h index 0c5659c41b01..f0268deca658 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -825,6 +825,10 @@ struct fb_tile_ops { | |||
825 | */ | 825 | */ |
826 | #define FBINFO_BE_MATH 0x100000 | 826 | #define FBINFO_BE_MATH 0x100000 |
827 | 827 | ||
828 | /* report to the VT layer that this fb driver can accept forced console | ||
829 | output like oopses */ | ||
830 | #define FBINFO_CAN_FORCE_OUTPUT 0x200000 | ||
831 | |||
828 | struct fb_info { | 832 | struct fb_info { |
829 | int node; | 833 | int node; |
830 | int flags; | 834 | int flags; |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 7f56db4a79f0..56cce345aa8d 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -100,6 +100,13 @@ extern int unbind_con_driver(const struct consw *csw, int first, int last, | |||
100 | int deflt); | 100 | int deflt); |
101 | int vty_init(const struct file_operations *console_fops); | 101 | int vty_init(const struct file_operations *console_fops); |
102 | 102 | ||
103 | static inline bool vt_force_oops_output(struct vc_data *vc) | ||
104 | { | ||
105 | if (oops_in_progress && vc->vc_panic_force_write) | ||
106 | return true; | ||
107 | return false; | ||
108 | } | ||
109 | |||
103 | /* | 110 | /* |
104 | * vc_screen.c shares this temporary buffer with the console write code so that | 111 | * vc_screen.c shares this temporary buffer with the console write code so that |
105 | * we can easily avoid touching user space while holding the console spinlock. | 112 | * we can easily avoid touching user space while holding the console spinlock. |