aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-08 16:35:29 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-08 16:35:29 -0500
commit830cd2ac6ecce6b027d947fcdc724dd27a33813a (patch)
tree08d4f60e9176292f98e47d1f50b77f1f49ec0122
parent64227cd83d5f9d7b7ce5514a693252c2952366f6 (diff)
parentb434a680a29424856e0f40199daa9f65963c7cb4 (diff)
Merge branch 'x86-setup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-setup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: vgacon: Add support for setting the default cursor state vc: Add support for hiding the cursor when creating VTs x86, setup: Store the boot cursor state
-rw-r--r--Documentation/kernel-parameters.txt9
-rw-r--r--arch/x86/boot/video.c6
-rw-r--r--drivers/char/vt.c11
-rw-r--r--drivers/video/console/vgacon.c5
-rw-r--r--include/linux/screen_info.h5
-rw-r--r--include/linux/vt_kern.h3
6 files changed, 37 insertions, 2 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 495a39a77341..777dc8a32df8 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2747,6 +2747,15 @@ and is between 256 and 4096 characters. It is defined in the file
2747 Default is 1, i.e. UTF-8 mode is enabled for all 2747 Default is 1, i.e. UTF-8 mode is enabled for all
2748 newly opened terminals. 2748 newly opened terminals.
2749 2749
2750 vt.global_cursor_default=
2751 [VT]
2752 Format=<-1|0|1>
2753 Set system-wide default for whether a cursor
2754 is shown on new VTs. Default is -1,
2755 i.e. cursors will be created by default unless
2756 overridden by individual drivers. 0 will hide
2757 cursors, 1 will display them.
2758
2750 waveartist= [HW,OSS] 2759 waveartist= [HW,OSS]
2751 Format: <io>,<irq>,<dma>,<dma2> 2760 Format: <io>,<irq>,<dma>,<dma2>
2752 2761
diff --git a/arch/x86/boot/video.c b/arch/x86/boot/video.c
index d42da3802499..f767164cd5df 100644
--- a/arch/x86/boot/video.c
+++ b/arch/x86/boot/video.c
@@ -27,6 +27,12 @@ static void store_cursor_position(void)
27 27
28 boot_params.screen_info.orig_x = oreg.dl; 28 boot_params.screen_info.orig_x = oreg.dl;
29 boot_params.screen_info.orig_y = oreg.dh; 29 boot_params.screen_info.orig_y = oreg.dh;
30
31 if (oreg.ch & 0x20)
32 boot_params.screen_info.flags |= VIDEO_FLAGS_NOCURSOR;
33
34 if ((oreg.ch & 0x1f) > (oreg.cl & 0x1f))
35 boot_params.screen_info.flags |= VIDEO_FLAGS_NOCURSOR;
30} 36}
31 37
32static void store_video_mode(void) 38static void store_video_mode(void)
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 0c80c68cd047..1e3d728dbf7e 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -161,6 +161,8 @@ static void set_palette(struct vc_data *vc);
161static int printable; /* Is console ready for printing? */ 161static int printable; /* Is console ready for printing? */
162int default_utf8 = true; 162int default_utf8 = true;
163module_param(default_utf8, int, S_IRUGO | S_IWUSR); 163module_param(default_utf8, int, S_IRUGO | S_IWUSR);
164int global_cursor_default = -1;
165module_param(global_cursor_default, int, S_IRUGO | S_IWUSR);
164 166
165/* 167/*
166 * ignore_poke: don't unblank the screen when things are typed. This is 168 * ignore_poke: don't unblank the screen when things are typed. This is
@@ -775,6 +777,12 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */
775 vc_cons[currcons].d = NULL; 777 vc_cons[currcons].d = NULL;
776 return -ENOMEM; 778 return -ENOMEM;
777 } 779 }
780
781 /* If no drivers have overridden us and the user didn't pass a
782 boot option, default to displaying the cursor */
783 if (global_cursor_default == -1)
784 global_cursor_default = 1;
785
778 vc_init(vc, vc->vc_rows, vc->vc_cols, 1); 786 vc_init(vc, vc->vc_rows, vc->vc_cols, 1);
779 vcs_make_sysfs(currcons); 787 vcs_make_sysfs(currcons);
780 atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, &param); 788 atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, &param);
@@ -1616,7 +1624,7 @@ static void reset_terminal(struct vc_data *vc, int do_clear)
1616 vc->vc_decscnm = 0; 1624 vc->vc_decscnm = 0;
1617 vc->vc_decom = 0; 1625 vc->vc_decom = 0;
1618 vc->vc_decawm = 1; 1626 vc->vc_decawm = 1;
1619 vc->vc_deccm = 1; 1627 vc->vc_deccm = global_cursor_default;
1620 vc->vc_decim = 0; 1628 vc->vc_decim = 0;
1621 1629
1622 set_kbd(vc, decarm); 1630 set_kbd(vc, decarm);
@@ -4078,6 +4086,7 @@ EXPORT_SYMBOL(fg_console);
4078EXPORT_SYMBOL(console_blank_hook); 4086EXPORT_SYMBOL(console_blank_hook);
4079EXPORT_SYMBOL(console_blanked); 4087EXPORT_SYMBOL(console_blanked);
4080EXPORT_SYMBOL(vc_cons); 4088EXPORT_SYMBOL(vc_cons);
4089EXPORT_SYMBOL(global_cursor_default);
4081#ifndef VT_SINGLE_DRIVER 4090#ifndef VT_SINGLE_DRIVER
4082EXPORT_SYMBOL(take_over_console); 4091EXPORT_SYMBOL(take_over_console);
4083EXPORT_SYMBOL(give_up_console); 4092EXPORT_SYMBOL(give_up_console);
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index da55ccaf4d55..cc4bbbe44aca 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -585,6 +585,11 @@ static void vgacon_init(struct vc_data *c, int init)
585 vgacon_uni_pagedir[1]++; 585 vgacon_uni_pagedir[1]++;
586 if (!vgacon_uni_pagedir[0] && p) 586 if (!vgacon_uni_pagedir[0] && p)
587 con_set_default_unimap(c); 587 con_set_default_unimap(c);
588
589 /* Only set the default if the user didn't deliberately override it */
590 if (global_cursor_default == -1)
591 global_cursor_default =
592 !(screen_info.flags & VIDEO_FLAGS_NOCURSOR);
588} 593}
589 594
590static void vgacon_deinit(struct vc_data *c) 595static void vgacon_deinit(struct vc_data *c)
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h
index 1ee2c05142f6..899fbb487c94 100644
--- a/include/linux/screen_info.h
+++ b/include/linux/screen_info.h
@@ -14,7 +14,8 @@ struct screen_info {
14 __u16 orig_video_page; /* 0x04 */ 14 __u16 orig_video_page; /* 0x04 */
15 __u8 orig_video_mode; /* 0x06 */ 15 __u8 orig_video_mode; /* 0x06 */
16 __u8 orig_video_cols; /* 0x07 */ 16 __u8 orig_video_cols; /* 0x07 */
17 __u16 unused2; /* 0x08 */ 17 __u8 flags; /* 0x08 */
18 __u8 unused2; /* 0x09 */
18 __u16 orig_video_ega_bx;/* 0x0a */ 19 __u16 orig_video_ega_bx;/* 0x0a */
19 __u16 unused3; /* 0x0c */ 20 __u16 unused3; /* 0x0c */
20 __u8 orig_video_lines; /* 0x0e */ 21 __u8 orig_video_lines; /* 0x0e */
@@ -65,6 +66,8 @@ struct screen_info {
65 66
66#define VIDEO_TYPE_EFI 0x70 /* EFI graphic mode */ 67#define VIDEO_TYPE_EFI 0x70 /* EFI graphic mode */
67 68
69#define VIDEO_FLAGS_NOCURSOR (1 << 0) /* The video mode has no cursor set */
70
68#ifdef __KERNEL__ 71#ifdef __KERNEL__
69extern struct screen_info screen_info; 72extern struct screen_info screen_info;
70 73
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index c0c4e1103a73..7f56db4a79f0 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -110,6 +110,7 @@ extern char con_buf[CON_BUF_SIZE];
110extern struct mutex con_buf_mtx; 110extern struct mutex con_buf_mtx;
111extern char vt_dont_switch; 111extern char vt_dont_switch;
112extern int default_utf8; 112extern int default_utf8;
113extern int global_cursor_default;
113 114
114struct vt_spawn_console { 115struct vt_spawn_console {
115 spinlock_t lock; 116 spinlock_t lock;
@@ -130,4 +131,6 @@ struct vt_notifier_param {
130extern int register_vt_notifier(struct notifier_block *nb); 131extern int register_vt_notifier(struct notifier_block *nb);
131extern int unregister_vt_notifier(struct notifier_block *nb); 132extern int unregister_vt_notifier(struct notifier_block *nb);
132 133
134extern void hide_boot_cursor(bool hide);
135
133#endif /* _VT_KERN_H */ 136#endif /* _VT_KERN_H */