Re: vt: regression caused by "Fix line garbage in virtual.."

From: Jean-Francois Moine
Date: Tue Nov 20 2012 - 03:53:49 EST


On Mon, 19 Nov 2012 22:15:53 +0100
Krzysztof Mazur <krzysiek@xxxxxxxxxxxx> wrote:

> That patch fixed the original issue, but I noticed another artifact
> (I tested only v3.7-rc6 after your fix, I didn't check if the same
> problems exists in v3.7).
>
> After:
>
> for ((i = 0; i < 40; i++)); do
> echo "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
> done
> echo -e -n "\x0d\x1b[2@"
>
> (also generated by bash during command line editing, this time by CTRL-r
> + something)
>
> the first character on screen (first column and first row) is cleared.
>
>
> I think it's too late for fixing it in 3.7 and it's better, like Alan
> proposed, to just revert it for now.

Thanks for testing. This time, the fix was easy.

But anyway, as it seems that my patch fixes only the Cubox machine and
as we are still using a kernel 3.5 with specific patches, the fix may
be delayed.

--->8 ---
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -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;

--
Ken ar c'hentaà | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/