Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752917AbbKASs1 (ORCPT ); Sun, 1 Nov 2015 13:48:27 -0500 Received: from smtpout-fallback.aon.at ([195.3.96.119]:62024 "EHLO smtpout-fallback.aon.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752408AbbKASs0 (ORCPT ); Sun, 1 Nov 2015 13:48:26 -0500 X-A1Mail-Track-Id: 1446403699:16094:smarthub77:193.81.116.183:1 Message-ID: <56365E72.6060206@aon.at> Date: Sun, 01 Nov 2015 19:48:18 +0100 From: Melchior FRANZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Greg Kroah-Hartman CC: Jiri Slaby , linux-kernel@vger.kernel.org, Melchior FRANZ Subject: [PATCH] tty: vt: initialize softcursor_original correctly Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1478 Lines: 35 add_softcursor() stores the contents of the text buffer position in this variable before drawing the softcursor, whereas hide_softcursor() writes the value back. A value of -1 means that no cursor has been drawn and therefore no character is to be restored. softcursor_original, however, is only implicitly initialized with 0. Therefore, when hide_softcursor is called for the first time (console_init -> con_init -> redraw_screen -> hide_cursor), it wrongly writes 0x0000 in the top left corner of the text buffer. Normally, this is just as black as the rest of the screen (vc_video_erase_char) and can't be seen, but it appears as a black cursor rectangle on non-black backgrounds e.g. with boot option "vt.global_cursor_default=0 vt.color=0xf0". softcursor_original needs to be initialized with -1. Signed-off-by: Melchior FRANZ --- diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 4462d16..8ea3543 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -568,7 +568,7 @@ static void delete_char(struct vc_data *vc, unsigned int nr) vc->vc_cols - vc->vc_x); } -static int softcursor_original; +static int softcursor_original = -1; static void add_softcursor(struct vc_data *vc) { -- 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/