Re: 2.1.105: console speedup patch ({delete,insert}_char)

Peter Samuelson (psamuels@sampo.creighton.edu)
Fri, 12 Jun 1998 03:52:43 -0500 (CDT)


[me]
> > --- linux/drivers/char/console.c.106pre Fri Jun 12 00:20:30 1998
> > +++ linux/drivers/char/console.c Thu Jun 11 23:26:49 1998
> > @@ -1257,8 +1257,9 @@
> > static void insert_char(int currcons, unsigned int nr)
> > {
> > unsigned int i = x;
> > - unsigned short * p, * q = (unsigned short *) pos;
> > + unsigned short * p, * q;
> >
> > + p = q = (unsigned short *) pos;
[Matija Nalis]
> Yes, that is intended behaviour. Thanks for fix.
> (don't know why it worked correctly in my tests)

Actually it's still buggy. If nr>1, insert_char() will clobber
characters. We need to copy from the end of the line (.105 used a
one-char temp buffer to avoid this). The following patch against
2.1.106pre seems to work (I actually tested this one...).

Peter Samuelson
<psamuels@sampo.creighton.edu>

--- linux/drivers/char/console.c.106pre Fri Jun 12 00:20:30 1998
+++ linux/drivers/char/console.c Fri Jun 12 03:41:00 1998
@@ -1256,13 +1256,12 @@

static void insert_char(int currcons, unsigned int nr)
{
- unsigned int i = x;
unsigned short * p, * q = (unsigned short *) pos;

- while (i++ <= video_num_columns - nr) {
+ p = q + video_num_columns - nr - x;
+ while (--p >= q)
scr_writew(scr_readw(p), p + nr);
- p++;
- }
+
memsetw(q, video_erase_char, nr*2);
need_wrap = 0;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu