Skip to contentSkip to conversation

fbcon: make cursor display conditional

PATCH In review Daniel Mack 7 participants 25 messages Nov 5, 2009 – Nov 13, 2009

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fbcon: make cursor display conditional

For embedded systems, the blinking cursor at startup time can be annoying and unintended. Add a new kernel parameter 'fbcon_disable_cursor' which disables it conditionally. The default behaviour is unchanged.

Cc Andrew Morton <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Andrea Righi <[email protected]>
---
 Documentation/kernel-parameters.txt |    3 +++
 drivers/video/console/fbcon.c       |   11 ++++++++++-
 2 files changed, 13 insertions(+), 1 deletions(-)
Documentation/kernel-parameters.txt +3 -0
index 9107b38..80ac54e 100644
@@ -743,6 +743,9 @@ and is between 256 and 4096 characters. It is defined in the file
 			Format: <interval>,<probability>,<space>,<times>
 			See also /Documentation/fault-injection/.
 
+	fbcon_disable_cursor
+			Disable the cursor in the framebuffer console
+
 	fd_mcs=		[HW,SCSI]
 			See header of drivers/scsi/fd_mcs.c.
 
drivers/video/console/fbcon.c +10 -1
index 5a686ce..039aa86 100644
@@ -116,6 +116,14 @@ static int fbcon_has_exited;
 static int primary_device = -1;
 static int fbcon_has_console_bind;
 
+static int fbcon_disable_cursor;
+static int __init _fbcon_disable_cursor(char *str)
+{
+	fbcon_disable_cursor = 1;
+	return 1;
+}
+__setup("fbcon_disable_cursor", _fbcon_disable_cursor);
+
 #ifdef CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY
 static int map_override;
 
@@ -1288,7 +1296,8 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
 	int y;
  	int c = scr_readw((u16 *) vc->vc_pos);
 
-	if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1)
+	if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1 ||
+	    fbcon_disable_cursor)
 		return;
 
 	if (vc->vc_cursor_type & 0x10)
Signature · 1 line
1.6.5
#1 lore raw
Quoted 3 lines · Daniel Mack

For embedded systems, the blinking cursor at startup time can be annoying and unintended. Add a new kernel parameter 'fbcon_disable_cursor' which disables it conditionally.

Wouldn't it be more useful to change the CUR_DEFAULT symbol (see the end of <linux/console_struct.h>) into a kernel parameter, instead of adding a new flag?

Best regards,
Clemens

#2 lore raw
Quoted 8 lines · Clemens Ladisch
Quoted 3 lines · Daniel Mack

For embedded systems, the blinking cursor at startup time can be annoying and unintended. Add a new kernel parameter 'fbcon_disable_cursor' which disables it conditionally.

Wouldn't it be more useful to change the CUR_DEFAULT symbol (see the end of <linux/console_struct.h>) into a kernel parameter, instead of adding a new flag?

Agreed. There's no need to choose if we want the blinking cursor or not at each boot. Better to make this decision at compile time.

-Andrea

#3 lore raw
Quoted 6 lines · Andrea Righi
Quoted 5 lines · Clemens Ladisch
Quoted 3 lines · Daniel Mack

For embedded systems, the blinking cursor at startup time can be annoying and unintended. Add a new kernel parameter 'fbcon_disable_cursor' which disables it conditionally.

Quoted 6 lines
Quoted 3 lines

Wouldn't it be more useful to change the CUR_DEFAULT symbol (see the end of <linux/console_struct.h>) into a kernel parameter, instead of adding a new flag?

Agreed. There's no need to choose if we want the blinking cursor or not at each boot. Better to make this decision at compile time.

Ok, much better idea, I agree. See the patch below.

Thanks for the input,
Daniel

Quoted 1 line

From 8192226c1cdda90ef0d73a55c02f632693065310 Mon Sep 17 00:00:00 2001

From: Daniel Mack <[email protected]>
Date: Fri, 6 Nov 2009 17:31:00 +0100
Subject: [PATCH] char/console: make default cursor type configurable

Make the default console cursor type configurable rather than hard-coding it.

Cc Clemens Ladisch <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
---
 drivers/char/Kconfig           |   27 +++++++++++++++++++++++++++
 drivers/char/vt.c              |   23 +++++++++++++++++++++++
 include/linux/console_struct.h |    2 --
 3 files changed, 50 insertions(+), 2 deletions(-)
drivers/char/Kconfig +27 -0
index 6aad99e..1e01ea4 100644
@@ -88,6 +88,33 @@ config VT_HW_CONSOLE_BINDING
 	 information. For framebuffer console users, please refer to
 	 <file:Documentation/fb/fbcon.txt>.
 
+choice
+	prompt "Console default cursor type"
+	depends on HW_CONSOLE
+	default CONSOLE_DEF_CUR_UNDERLINE
+	help
+	  This option selects the default cursor type for the text console.
+
+config CONSOLE_DEF_CUR_NONE
+	bool "none"
+
+config CONSOLE_DEF_CUR_UNDERLINE
+	bool "underline"
+
+config CONSOLE_DEF_CUR_LOWER_THIRD
+	bool "lower third"
+
+config CONSOLE_DEF_CUR_LOWER_HALF
+	bool "lower half"
+
+config CONSOLE_DEF_CUR_TWO_THIRDS
+	bool "two thirds"
+
+config CONSOLE_DEF_CUR_BLOCK
+	bool "block"
+
+endchoice
+
 config DEVKMEM
 	bool "/dev/kmem virtual device support"
 	default y
drivers/char/vt.c +23 -0
index 0c80c68..0078f6e 100644
@@ -111,6 +111,29 @@
 #define CON_DRIVER_FLAG_INIT   2
 #define CON_DRIVER_FLAG_ATTR   4
 
+#if defined(CONFIG_CONSOLE_DEF_CUR_NONE)
+#define CUR_DEFAULT CUR_NONE
+
+#elif defined(CONFIG_CONSOLE_DEF_CUR_UNDERLINE)
+#define CUR_DEFAULT CUR_UNDERLINE
+
+#elif defined(CONFIG_CONSOLE_DEF_CUR_LOWER_THIRD)
+#define CUR_DEFAULT CUR_LOWER_THIRD
+
+#elif defined(CONFIG_CONSOLE_DEF_CUR_LOWER_HALF)
+#define CUR_DEFAULT CUR_LOWER_HALF
+
+#elif defined(CONFIG_CONSOLE_DEF_CUR_TWO_THIRDS)
+#define CUR_DEFAULT CUR_TWO_THIRDS
+
+#elif defined(CONFIG_CONSOLE_DEF_CUR_BLOCK)
+#define CUR_DEFAULT CUR_BLOCK
+
+#else
+#warning "no default console cursor type defined, defaulting to 'underline'"
+#define CUR_DEFAULT CUR_UNDERLINE
+#endif
+
 struct con_driver {
 	const struct consw *con;
 	const char *desc;
include/linux/console_struct.h +0 -2
index 38fe59d..6c024a0 100644
@@ -130,8 +130,6 @@ extern void vc_SAK(struct work_struct *work);
 #define CUR_HWMASK	0x0f
 #define CUR_SWMASK	0xfff0
 
-#define CUR_DEFAULT CUR_UNDERLINE
-
 #define CON_IS_VISIBLE(conp) (*conp->vc_display_fg == conp)
 
 #endif /* _LINUX_CONSOLE_STRUCT_H */
Signature · 1 line
1.6.5.2
#4 lore raw
Quoted 11 lines · Daniel Mack
Quoted 4 lines · Clemens Ladisch
Quoted 3 lines

Wouldn't it be more useful to change the CUR_DEFAULT symbol (see the end of <linux/console_struct.h>) into a kernel parameter, instead of adding a new flag?

Ok, much better idea, I agree. See the patch below.

Subject: [PATCH] char/console: make default cursor type configurable

drivers/char/vt.c

Quoted 6 lines
drivers/char/vt.c +6 -0
+#if defined(CONFIG_CONSOLE_DEF_CUR_NONE)
+#define CUR_DEFAULT CUR_NONE
+
+#elif defined(CONFIG_CONSOLE_DEF_CUR_UNDERLINE)
+#define CUR_DEFAULT CUR_UNDERLINE
+...

With a separate Kconfig variable, we can avoid having to put the parallel list into vt.c.

Furthermore, we can add options for the software cursor while we're at it; something like this:

include/linux/console_struct.h +0 -2
@@ -130,8 +130,6 @@ extern void vc_SAK(struct work_struct *w
 #define CUR_HWMASK	0x0f
 #define CUR_SWMASK	0xfff0
 
-#define CUR_DEFAULT CUR_UNDERLINE
-
 #define CON_IS_VISIBLE(conp) (*conp->vc_display_fg == conp)
 
 #endif /* _LINUX_CONSOLE_STRUCT_H */
drivers/char/vt.c +5 -0
@@ -138,6 +138,11 @@ const struct consw *conswitchp;
 #define DEFAULT_BELL_PITCH	750
 #define DEFAULT_BELL_DURATION	(HZ/8)
 
+#define CUR_DEFAULT (CONFIG_CUR_DEFAULT_HW | \
+		     CONFIG_CUR_DEFAULT_SW_FLAGS | \
+		     (CONFIG_CUR_DEFAULT_SW_ATTR_XOR << 8) | \
+		     (CONFIG_CUR_DEFAULT_SW_ATTR_SET << 16))
+
 struct vc vc_cons [MAX_NR_CONSOLES];
 
 #ifndef VT_SINGLE_DRIVER
drivers/char/Kconfig +98 -0

104 lines not on this page · raw message

#5 lore raw
Quoted 22 lines · Clemens Ladisch
Quoted 11 lines · Daniel Mack
Quoted 4 lines · Clemens Ladisch
Quoted 3 lines

Wouldn't it be more useful to change the CUR_DEFAULT symbol (see the end of <linux/console_struct.h>) into a kernel parameter, instead of adding a new flag?

Ok, much better idea, I agree. See the patch below.

Subject: [PATCH] char/console: make default cursor type configurable

drivers/char/vt.c

Quoted 6 lines
drivers/char/vt.c +6 -0
+#if defined(CONFIG_CONSOLE_DEF_CUR_NONE)
+#define CUR_DEFAULT CUR_NONE
+
+#elif defined(CONFIG_CONSOLE_DEF_CUR_UNDERLINE)
+#define CUR_DEFAULT CUR_UNDERLINE
+...

With a separate Kconfig variable, we can avoid having to put the parallel list into vt.c.

Quoted 4 lines

Furthermore, we can add options for the software cursor while we're at it; something like this:

Wonderful, thank you. For my bits, you can add my Signed-off-by if that's appropriate.

Daniel

Quoted 132 lines
include/linux/console_struct.h +0 -2
@@ -130,8 +130,6 @@ extern void vc_SAK(struct work_struct *w
 #define CUR_HWMASK	0x0f
 #define CUR_SWMASK	0xfff0
 
-#define CUR_DEFAULT CUR_UNDERLINE
-
 #define CON_IS_VISIBLE(conp) (*conp->vc_display_fg == conp)
 
 #endif /* _LINUX_CONSOLE_STRUCT_H */
drivers/char/vt.c +5 -0
@@ -138,6 +138,11 @@ const struct consw *conswitchp;
 #define DEFAULT_BELL_PITCH	750
 #define DEFAULT_BELL_DURATION	(HZ/8)
 
+#define CUR_DEFAULT (CONFIG_CUR_DEFAULT_HW | \
+		     CONFIG_CUR_DEFAULT_SW_FLAGS | \
+		     (CONFIG_CUR_DEFAULT_SW_ATTR_XOR << 8) | \
+		     (CONFIG_CUR_DEFAULT_SW_ATTR_SET << 16))
+
 struct vc vc_cons [MAX_NR_CONSOLES];
 
 #ifndef VT_SINGLE_DRIVER
drivers/char/Kconfig +98 -0
@@ -88,6 +88,104 @@ config VT_HW_CONSOLE_BINDING
 	 information. For framebuffer console users, please refer to
 	 <file:Documentation/fb/fbcon.txt>.
 
+choice
+	prompt "Default hardware cursor shape"
+	depends on HW_CONSOLE
+	default CUR_DEFAULT_UNDERLINE
+	help
+	  Select the default shape of the blinking hardware cursor.
+
+	config CUR_DEFAULT_DEF
+		bool "Default"
+	config CUR_DEFAULT_NONE
+		bool "None"
+	config CUR_DEFAULT_UNDERLINE
+		bool "Underline"
+	config CUR_DEFAULT_LOWER_THIRD
+		bool "Lower third"
+	config CUR_DEFAULT_LOWER_HALF
+		bool "Lower half"
+	config CUR_DEFAULT_TWO_THIRDS
+		bool "Two thirds"
+	config CUR_DEFAULT_BLOCK
+		bool "Block"
+endchoice
+
+config CUR_DEFAULT_HW
+	depends on HW_CONSOLE
+	int
+	default 0 if CUR_DEFAULT_DEF
+	default 1 if CUR_DEFAULT_NONE
+	default 2 if CUR_DEFAULT_UNDERLINE
+	default 3 if CUR_DEFAULT_LOWER_THIRD
+	default 4 if CUR_DEFAULT_LOWER_HALF
+	default 5 if CUR_DEFAULT_TWO_THIRDS
+	default 6 if CUR_DEFAULT_BLOCK
+
+config CUR_DEFAULT_SW
+	bool "Use software cursor by default"
+	depends on HW_CONSOLE
+	default n
+	help
+	  The software cursor allows you to customize the appearance of the
+	  cursor; this is done by changing the attributes (the color) of the
+	  character under the cursor.
+
+	  See <file:Documentation/VGA-softcursor.txt> for more information.
+
+config CUR_DEFAULT_SW_ATTR_XOR
+	depends on HW_CONSOLE
+	prompt "Software cursor changed attribute bits" if CUR_DEFAULT_SW
+	int
+	range 0 255
+	default 0
+	help
+	  Enter the character attribute bits that are changed by the
+	  software cursor. This is equivalent to the second parameter
+	  of the <ESC>[?1;2;3c escape sequence; for more information,
+	  see <file:Documentation/VGA-softcursor.txt>.
+
+config CUR_DEFAULT_SW_ATTR_SET
+	depends on HW_CONSOLE
+	prompt "Software cursor set attribute bits" if CUR_DEFAULT_SW
+	int
+	range 0 255
+	default 0
+	help
+	  Enter the character attribute bits that are set by the
+	  software cursor. This is equivalent to the third parameter
+	  of the <ESC>[?1;2;3c escape sequence; for more information,
+	  see <file:Documentation/VGA-softcursor.txt>.
+
+config CUR_DEFAULT_SW_CHANGE_BKGND
+	bool "Software cursor always changes background"
+	depends on CUR_DEFAULT_SW
+	default y
+	help
+	  If you say Y here, the software cursor will ensure that the
+	  background color of the character under the cursor is changed,
+	  even if the cursor color is the same as the original character's
+	  color.
+
+config CUR_DEFAULT_SW_BKGND_DIFFERENT
+	bool "Software cursor makes foreground color different from background"
+	depends on CUR_DEFAULT_SW
+	default y
+	help
+	  If you say Y here, the software cursor will ensure that the
+	  foreground color of the character under the cursor is different
+	  from the background color.
+
+config CUR_DEFAULT_SW_FLAGS
+	depends on HW_CONSOLE
+	int
+	default 0 if !CUR_DEFAULT_SW
+	# 16 + (32 if CHANGE_BKGND) + (64 if BKGND_DIFFERENT):
+	default 16 if !CUR_DEFAULT_SW_CHANGE_BKGND && !CUR_DEFAULT_SW_BKGND_DIFFERENT
+	default 48 if CUR_DEFAULT_SW_CHANGE_BKGND && !CUR_DEFAULT_SW_BKGND_DIFFERENT
+	default 80 if !CUR_DEFAULT_SW_CHANGE_BKGND && CUR_DEFAULT_SW_BKGND_DIFFERENT
+	default 112 if CUR_DEFAULT_SW_CHANGE_BKGND && CUR_DEFAULT_SW_BKGND_DIFFERENT
+
 config DEVKMEM
 	bool "/dev/kmem virtual device support"
 	default y
#6 lore raw

PATCH 1/1 vt: make the default cursor shape configurable

Make the default console cursor type configurable rather than hard-coding it.

include/linux/console_struct.h +0 -2
@@ -130,8 +130,6 @@ extern void vc_SAK(struct work_struct *w
 #define CUR_HWMASK	0x0f
 #define CUR_SWMASK	0xfff0
 
-#define CUR_DEFAULT CUR_UNDERLINE
-
 #define CON_IS_VISIBLE(conp) (*conp->vc_display_fg == conp)
 
 #endif /* _LINUX_CONSOLE_STRUCT_H */
drivers/char/vt.c +5 -0
@@ -138,6 +138,11 @@ const struct consw *conswitchp;
 #define DEFAULT_BELL_PITCH	750
 #define DEFAULT_BELL_DURATION	(HZ/8)
 
+#define CUR_DEFAULT (CONFIG_CUR_DEFAULT_HW | \
+		     CONFIG_CUR_DEFAULT_SW_FLAGS | \
+		     (CONFIG_CUR_DEFAULT_SW_ATTR_XOR << 8) | \
+		     (CONFIG_CUR_DEFAULT_SW_ATTR_SET << 16))
+
 struct vc vc_cons [MAX_NR_CONSOLES];
 
 #ifndef VT_SINGLE_DRIVER
drivers/char/Kconfig +98 -0

104 lines not on this page · raw message

#7 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

Quoted 2 lines · On Mon, 09 Nov 2009 10:15:45 +0100 Clemens Ladisch <[email protected]> wrote:

Make the default console cursor type configurable rather than hard-coding it.

You can set the cursor type at runtime so this all seems unjustified and doing this kind of thing at build time is definitely the wrong place.

Alan

#8 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

Quoted 6 lines · Alan Cox
Quoted 2 lines · Clemens Ladisch

Make the default console cursor type configurable rather than hard-coding it.

You can set the cursor type at runtime so this all seems unjustified and doing this kind of thing at build time is definitely the wrong place.

The justification from Daniel's original patch was:
| For embedded systems, the blinking cursor at startup time can be | annoying and unintended.

Would a simple "Disable cursor by default" switch more acceptable?

Clemens

#9 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

Quoted 5 lines

The justification from Daniel's original patch was:
| For embedded systems, the blinking cursor at startup time can be | annoying and unintended.

Would a simple "Disable cursor by default" switch more acceptable?

Well I guess you could just make the default cursor define a variable and mark it MODULE_PARAM ?

Alan

#10 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

Quoted 8 lines · Alan Cox
Quoted 5 lines

The justification from Daniel's original patch was:
| For embedded systems, the blinking cursor at startup time can be | annoying and unintended.

Would a simple "Disable cursor by default" switch more acceptable?

Well I guess you could just make the default cursor define a variable and mark it MODULE_PARAM ?

The original thread started here: <http://lkml.org/lkml/2009/11/5/71>.
To quote Andrea:
| There's no need to choose if we want the blinking cursor or not | at each boot.

Clemens

#11 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

In reply to Alan Cox
Quoted 8 lines · Alan Cox
Quoted 5 lines

The justification from Daniel's original patch was:
| For embedded systems, the blinking cursor at startup time can be | annoying and unintended.

Would a simple "Disable cursor by default" switch more acceptable?

Well I guess you could just make the default cursor define a variable and mark it MODULE_PARAM ?

I had that previously and the response was that there is no reason to define that setting per-boot process, as it is rather unlikely that you want to change it from one boot to the next. Hence, it should be set at compile time.

And even if the cursor behaviour is changable at runtime, I don't see why it shouldn't have a selectable compile time default. Which is what the patch adds.

Daniel

#12 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

Quoted 5 lines · Daniel Mack

I had that previously and the response was that there is no reason to define that setting per-boot process, as it is rather unlikely that you want to change it from one boot to the next. Hence, it should be set at compile time.

It should be set as a boot parameter, since this is fixed at system installation and then left untouched.

Quoted 3 lines

And even if the cursor behaviour is changable at runtime, I don't see why it shouldn't have a selectable compile time default. Which is what the patch adds.

It seems like adding cruft to the kernel that is just as effectively available at run-time. Where does it end? Do we eventually add bash to the kernel?

#13 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

Quoted 9 lines · David Newall
Quoted 5 lines · Daniel Mack

I had that previously and the response was that there is no reason to define that setting per-boot process, as it is rather unlikely that you want to change it from one boot to the next. Hence, it should be set at compile time.

It should be set as a boot parameter, since this is fixed at system installation and then left untouched.

I'd be fine with either way. As long as it disables the blinking cursor.

Quoted 3 lines

It seems like adding cruft to the kernel that is just as effectively available at run-time. Where does it end? Do we eventually add bash to the kernel?

Well, all I need is a way to disable the cursor at boot time, as we don't want it to be in our boot screen on a embedded system. It is not only ruin the aesthetics but also gives the wrong assumption that the system awaits input. There is no userspace at this point, so that's no option.

My first approach was adding a __setup variable to select that, but it wasn't beloved by the people get_maintainer.pl spit out. So I made it compile-time definable, and Clemens extended that to a more powerful interface of settings.

I don't really have a strong opinion on which way to go, all I need is a cursor-free system startup :) And I would of course prefer that patch to be in mainline.

Daniel

#14 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

In reply to David Newall
Quoted 9 lines · David Newall
Quoted 3 lines · Daniel Mack

And even if the cursor behaviour is changable at runtime, I don't see why it shouldn't have a selectable compile time default. Which is what the patch adds.

It seems like adding cruft to the kernel that is just as effectively available at run-time. Where does it end? Do we eventually add bash to the kernel?

One more thing:

Clemens' last patch didn't add anything to the kernel's binary size. It didn't slow down anything either, as there is no run-time condition evaluation. It just makes something configurable which was hard coded before. So where's the cruft?

The comparison to 'bash in the kernel' is really inappropriate.

Daniel

#15 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

Quoted 13 lines · Daniel Mack
Quoted 10 lines · David Newall
Quoted 4 lines · Daniel Mack

And even if the cursor behaviour is changable at runtime, I don't see why it shouldn't have a selectable compile time default. Which is what the patch adds.

It seems like adding cruft to the kernel that is just as effectively available at run-time. Where does it end? Do we eventually add bash to the kernel?

Quoted 7 lines

One more thing:

Clemens' last patch didn't add anything to the kernel's binary size. It didn't slow down anything either, as there is no run-time condition evaluation. It just makes something configurable which was hard coded before. So where's the cruft?

In this case the cruft is yet more kernel configuration choices to confuse and bewilder. The problems caused by cruft are more from its accretion than from any single part of it. Being able to argue that a crufty feature causes no change to speed or size misses that point.

Everything should be in the kernel, except those things that don't need to be (with apologies to Enstein).

I'm having trouble seeing a flashing cursor during device startup as a problem. I expect it will prove a useful diagnostic, one day. I think you can turn it off (from user space) within a couple of seconds of power on; you did say embedded, didn't you? Perhaps you even can configure your hardware to not display the cursor on startup, which is the second likeliest (after user-space) place to satisfy your needs.

#16 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

Quoted 6 lines · David Newall

I'm having trouble seeing a flashing cursor during device startup as a problem. I expect it will prove a useful diagnostic, one day. I think you can turn it off (from user space) within a couple of seconds of power on; you did say embedded, didn't you? Perhaps you even can configure your hardware to not display the cursor on startup, which is the second likeliest (after user-space) place to satisfy your needs.

I'm talking about an embedded device with no keyboard connected but only a touch screen. In this case, the cursor is clearly misleading, as there is no input device to use it. And for such a case (and I'm sure I'm not the only one having it), a way to switch the cursor off is much appreciated. I don't believe that's so hard to understand, really.

"A couple of seconds" is still too much. We don't want to give the impression of a terminal at all. The whole application starting afterwards has no cursor either.

Daniel

#17 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

Quoted 3 lines · Daniel Mack

"A couple of seconds" is still too much. We don't want to give the impression of a terminal at all. The whole application starting afterwards has no cursor either.

Or even half a second. Devices regularly flash and squiggle on startup, often as a diagnostic. Did you look at initialising your display controller in graphics mode, or with the cursor off?

#18 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

Quoted 8 lines · David Newall
Quoted 3 lines · Daniel Mack

"A couple of seconds" is still too much. We don't want to give the impression of a terminal at all. The whole application starting afterwards has no cursor either.

Or even half a second. Devices regularly flash and squiggle on startup, often as a diagnostic. Did you look at initialising your display controller in graphics mode, or with the cursor off?

It's a dumb framebuffer device, fbcon handles the rest. From the moment when the framebuffer is initalized until the userspace comes up, it takes ~5 secs, and at this time, we don't want to see the cursor.

#19 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

In reply to Daniel Mack
Quoted 11 lines · Daniel Mack
Quoted 9 lines · David Newall
Quoted 3 lines · Daniel Mack

And even if the cursor behaviour is changable at runtime, I don't see why it shouldn't have a selectable compile time default. Which is what the patch adds.

It seems like adding cruft to the kernel that is just as effectively available at run-time. Where does it end? Do we eventually add bash to the kernel?

Quoted 6 lines

One more thing:

Clemens' last patch didn't add anything to the kernel's binary size. It didn't slow down anything either, as there is no run-time condition evaluation. It just makes something configurable which was hard coded before. So where's the cruft?

The number of configs to test just got bigger. 100% bigger in fact. Every single developer will have to answer 'do you want blinking cursor?' when your patch is merged.

config options _are_ expensive.

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#20 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

Quoted 19 lines · On Tue, 10 Nov 2009 22:09:41 +0100 Pavel Machek <[email protected]> wrote:
Quoted 11 lines · Daniel Mack
Quoted 9 lines · David Newall
Quoted 3 lines · Daniel Mack

And even if the cursor behaviour is changable at runtime, I don't see why it shouldn't have a selectable compile time default. Which is what the patch adds.

It seems like adding cruft to the kernel that is just as effectively available at run-time. Where does it end? Do we eventually add bash to the kernel?

Quoted 6 lines

One more thing:

Clemens' last patch didn't add anything to the kernel's binary size. It didn't slow down anything either, as there is no run-time condition evaluation. It just makes something configurable which was hard coded before. So where's the cruft?

Quoted 6 lines

The number of configs to test just got bigger. 100% bigger in fact. Every single developer will have to answer 'do you want blinking cursor?' when your patch is merged.

config options _are_ expensive.

Plus it's nice not to have to rebuild and reinstall the kernel to flip a single bit...

The module_param() approach seems OK to me.

The initial patch was busted, IMO:

Review static void fbcon_cursor(struct vc_data *vc, int mode) · line 1301

Quoted 8 lines
(quoted diff) +2 -1
@@ -1288,7 +1296,8 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
 	int y;
 	int c = scr_readw((u16 *) vc->vc_pos);
 
-	if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1)
+	if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1 ||
+	    fbcon_disable_cursor)
 		return;

this will disable the cursor forever, afacit. So if you boot with the fbcon_disable_cursor option, you cannot later enable the cursor.

#21 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

Quoted 23 lines · Andrew Morton
Quoted 22 lines · Pavel Machek
Quoted 10 lines · Daniel Mack
Quoted 8 lines · David Newall
Quoted 3 lines · Daniel Mack

And even if the cursor behaviour is changable at runtime, I don't see why it shouldn't have a selectable compile time default. Which is what the patch adds.

It seems like adding cruft to the kernel that is just as effectively available at run-time. Where does it end? Do we eventually add bash to the kernel?

Quoted 6 lines

One more thing:

Clemens' last patch didn't add anything to the kernel's binary size. It didn't slow down anything either, as there is no run-time condition evaluation. It just makes something configurable which was hard coded before. So where's the cruft?

The number of configs to test just got bigger. 100% bigger in fact. Every single developer will have to answer 'do you want blinking cursor?' when your patch is merged.

Quoted 6 lines
Quoted 1 line

config options _are_ expensive.

Plus it's nice not to have to rebuild and reinstall the kernel to flip a single bit...

The module_param() approach seems OK to me.

[PATCH] vt: make the default cursor shape configurable

Make the default console cursor type configurable rather than hard-coding it.

Documentation/kernel-parameters.txt +5 -0
index 9107b38..750a42f 100644
@@ -2704,6 +2704,11 @@ and is between 256 and 4096 characters. It is defined in the file
 	vmpoff=		[KNL,S390] Perform z/VM CP command after power off.
 			Format: <command>
 
+	vt.cur_default=	[VT] Default cursor shape.
+			Format: 0xCCBBAA, where AA, BB, and CC are the same as
+			the parameters of the <Esc>[?A;B;Cc escape sequence;
+			see VGA-softcursor.txt. Default: 2 = underline.
+
 	vt.default_blu=	[VT]
 			Format: <blue0>,<blue1>,<blue2>,...,<blue15>
 			Change the default blue palette of the console.
drivers/char/vt.c +5 -2
index 0c80c68..21dd136 100644
@@ -162,6 +162,9 @@ static int printable;		/* Is console ready for printing? */
 int default_utf8 = true;
 module_param(default_utf8, int, S_IRUGO | S_IWUSR);
 
+static int cur_default = CUR_DEFAULT;
+module_param(cur_default, int, S_IRUGO | S_IWUSR);
+
 /*
  * ignore_poke: don't unblank the screen when things are typed.  This is
  * mainly for the privacy of braille terminal users.
@@ -1630,7 +1633,7 @@ static void reset_terminal(struct vc_data *vc, int do_clear)
 	/* do not do set_leds here because this causes an endless tasklet loop
 	   when the keyboard hasn't been initialized yet */
 
-	vc->vc_cursor_type = CUR_DEFAULT;
+	vc->vc_cursor_type = cur_default;
 	vc->vc_complement_mask = vc->vc_s_complement_mask;
 
 	default_attr(vc);
@@ -1832,7 +1835,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c)
 				if (vc->vc_par[0])
 					vc->vc_cursor_type = vc->vc_par[0] | (vc->vc_par[1] << 8) | (vc->vc_par[2] << 16);
 				else
-					vc->vc_cursor_type = CUR_DEFAULT;
+					vc->vc_cursor_type = cur_default;
 				return;
 			}
 			break;
#22 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

Quoted 6 lines

[PATCH] vt: make the default cursor shape configurable

Make the default console cursor type configurable rather than hard-coding it.

ACK.

Quoted 12 lines
Documentation/kernel-parameters.txt +5 -0
@@ -2704,6 +2704,11 @@ and is between 256 and 4096 characters. It is defined in the file
 	vmpoff=		[KNL,S390] Perform z/VM CP command after power off.
 			Format: <command>
 
+	vt.cur_default=	[VT] Default cursor shape.
+			Format: 0xCCBBAA, where AA, BB, and CC are the same as
+			the parameters of the <Esc>[?A;B;Cc escape sequence;
+			see VGA-softcursor.txt. Default: 2 = underline.
+
 	vt.default_blu=	[VT]
 			Format: <blue0>,<blue1>,<blue2>,...,<blue15>
 			Change the default blue palette of the console.
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#23 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

In reply to Clemens Ladisch
Quoted 6 lines · On Wed, 11 Nov 2009 07:56:59 +0100 Clemens Ladisch <[email protected]> wrote:

[PATCH] vt: make the default cursor shape configurable

Make the default console cursor type configurable rather than hard-coding it.

The changelog omitted the most important piece of information: the reason why we're making this change to the kernel.

I could type that in myself, but writing people's changelog for them gets a bit dull after the first few thousand. Please send a new, complete changelog for this patch.

Acked-by Pavel Machek
#24 lore raw

Re: [PATCH] vt: make the default cursor shape configurable

Quoted 8 lines · Andrew Morton
Quoted 4 lines · Clemens Ladisch

[PATCH] vt: make the default cursor shape configurable

Make the default console cursor type configurable rather than hard-coding it.

The changelog omitted the most important piece of information: the reason why we're making this change to the kernel.

[PATCH] vt: make the default cursor shape configurable

For embedded systems, the blinking cursor at startup time can be annoying and unintended. Add a new kernel parameter to change the default cursor shape.

---
Daniel, could you ack this?