Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754950AbZKIJPm (ORCPT ); Mon, 9 Nov 2009 04:15:42 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754887AbZKIJPm (ORCPT ); Mon, 9 Nov 2009 04:15:42 -0500 Received: from smtprelay03.ispgateway.de ([80.67.31.37]:60669 "EHLO smtprelay03.ispgateway.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754816AbZKIJPl (ORCPT ); Mon, 9 Nov 2009 04:15:41 -0500 Message-ID: <4AF7DDC1.4090006@ladisch.de> Date: Mon, 09 Nov 2009 10:15:45 +0100 From: Clemens Ladisch User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Greg Kroah-Hartman CC: Daniel Mack , Andrew Morton , Geert Uytterhoeven , linux-kernel@vger.kernel.org Subject: [PATCH] vt: make the default cursor shape configurable References: <4AF7D439.4030305@ladisch.de> <20091109091044.GX29442@buzzloop.caiaq.de> In-Reply-To: <20091109091044.GX29442@buzzloop.caiaq.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Df-Sender: linux-kernel@cl.domainfactory-kunde.de Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4623 Lines: 143 Make the default console cursor type configurable rather than hard-coding it. Signed-off-by: Daniel Mack Signed-off-by: Clemens Ladisch --- linux-2.6/include/linux/console_struct.h +++ linux-2.6/include/linux/console_struct.h @@ -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 */ --- linux-2.6/drivers/char/vt.c +++ linux-2.6/drivers/char/vt.c @@ -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 --- linux-2.6/drivers/char/Kconfig +++ linux-2.6/drivers/char/Kconfig @@ -88,6 +88,104 @@ config VT_HW_CONSOLE_BINDING information. For framebuffer console users, please refer to . +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 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 [?1;2;3c escape sequence; for more information, + see . + +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 [?1;2;3c escape sequence; for more information, + see . + +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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/