All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tty: vt: initialize softcursor_original correctly
@ 2015-11-01 18:48 Melchior FRANZ
  0 siblings, 0 replies; only message in thread
From: Melchior FRANZ @ 2015-11-01 18:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Jiri Slaby, linux-kernel, Melchior FRANZ

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 <mfranz@aon.at>
---

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)
  {

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-01 18:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-01 18:48 [PATCH] tty: vt: initialize softcursor_original correctly Melchior FRANZ

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.