Skip to contentSkip to conversation

tty vt: Fix a regression in command line edition

PATCH In review Jean-Francois Moine 2 participants 2 messages Nov 20, 2012 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty vt: Fix a regression in command line edition

From: Jean-François Moine <[email protected]>

The commit 81732c3b2fede049a692e58a7ceabb6d18ffb18c
("Fix line garbage in virtual console on command line edition") made a regression with some machines: some characters were not erased after line edition.

This patch adjusts the number of moved characters and the size of the region to be updated.

It may be applied on both kernels 3.6 and 3.7.

drivers/tty/vt/vt.c +4 -4
@@ -539,25 +539,25 @@
 {
 	unsigned short *p = (unsigned short *) vc->vc_pos;
 
-	scr_memmovew(p + nr, p, vc->vc_cols - vc->vc_x);
+	scr_memmovew(p + nr, p, (vc->vc_cols - vc->vc_x) * 2);
 	scr_memsetw(p, vc->vc_video_erase_char, nr * 2);
 	vc->vc_need_wrap = 0;
 	if (DO_UPDATE(vc))
 		do_update_region(vc, (unsigned long) p,
-			(vc->vc_cols - vc->vc_x) / 2 + 1);
+			vc->vc_cols - vc->vc_x);
 }
 
 static void delete_char(struct vc_data *vc, unsigned int nr)
 {
 	unsigned short *p = (unsigned short *) vc->vc_pos;
 
-	scr_memcpyw(p, p + nr, vc->vc_cols - vc->vc_x - nr);
+	scr_memcpyw(p, p + nr, (vc->vc_cols - vc->vc_x - nr) * 2);
 	scr_memsetw(p + vc->vc_cols - vc->vc_x - nr, vc->vc_video_erase_char,
 			nr * 2);
 	vc->vc_need_wrap = 0;
 	if (DO_UPDATE(vc))
 		do_update_region(vc, (unsigned long) p,
-			(vc->vc_cols - vc->vc_x) / 2);
+			vc->vc_cols - vc->vc_x);
 }
 
 static int softcursor_original;
Signature · 2 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
#1 lore raw
Quoted 7 lines · Jean-Francois Moine

From: Jean-François Moine <[email protected]>

The commit 81732c3b2fede049a692e58a7ceabb6d18ffb18c
("Fix line garbage in virtual console on command line edition") made a regression with some machines: some characters were not erased after line edition.

Quoted 5 lines

This patch adjusts the number of moved characters and the size of the region to be updated.

It may be applied on both kernels 3.6 and 3.7.

3.6? Commit 81732c exists only in 3.7. 3.6 is not affected.

Krzysiek