Skip to content

Commit 9fac2ff

Browse files
dlechProject516
authored andcommitted
add default_screen_mode parameter for vt
This is needed to correctly display the boot logo with a white background on a monochrome display.
1 parent 43ec2f4 commit 9fac2ff

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

drivers/tty/vt/vt.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*
3939
* - Arno Griffioen <[email protected]>
4040
* - David Carter <[email protected]>
41-
*
41+
*
4242
* The abstract console driver provides a generic interface for a text
4343
* console. It supports VGA text mode, frame buffer based graphical consoles
4444
* and special graphics processors that are only accessible through some
@@ -158,9 +158,12 @@ static void unblank_screen(void);
158158

159159
int default_utf8 = true;
160160
module_param(default_utf8, int, S_IRUGO | S_IWUSR);
161-
int global_cursor_default = -1;
161+
int global_cursor_default = 0;
162162
module_param(global_cursor_default, int, S_IRUGO | S_IWUSR);
163163
EXPORT_SYMBOL(global_cursor_default);
164+
int default_screen_mode = -1;
165+
module_param(default_screen_mode, int, S_IRUGO | S_IWUSR);
166+
EXPORT_SYMBOL(default_screen_mode);
164167

165168
static int cur_default = CUR_UNDERLINE;
166169
module_param(cur_default, int, S_IRUGO | S_IWUSR);
@@ -1086,9 +1089,12 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */
10861089
goto err_free;
10871090

10881091
/* If no drivers have overridden us and the user didn't pass a
1089-
boot option, default to displaying the cursor */
1092+
boot option, default to displaying the cursor and normal
1093+
screen mode */
10901094
if (global_cursor_default == -1)
10911095
global_cursor_default = 1;
1096+
if (default_screen_mode == -1)
1097+
default_screen_mode = 1;
10921098

10931099
vc_init(vc, 1);
10941100
vcs_make_sysfs(currcons);
@@ -2155,7 +2161,7 @@ static void reset_terminal(struct vc_data *vc, int do_clear)
21552161
vc->vc_disp_ctrl = 0;
21562162
vc->vc_toggle_meta = 0;
21572163

2158-
vc->vc_decscnm = 0;
2164+
vc->vc_decscnm = default_screen_mode;
21592165
vc->vc_decom = 0;
21602166
vc->vc_decawm = 1;
21612167
vc->vc_deccm = global_cursor_default;

include/linux/vt_kern.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ int vty_init(const struct file_operations *console_fops);
130130
extern bool vt_dont_switch;
131131
extern int default_utf8;
132132
extern int global_cursor_default;
133+
extern int default_screen_mode;
133134

134135
struct vt_spawn_console {
135136
spinlock_t lock;

0 commit comments

Comments
 (0)