From: Krzysztof H. <krz...@po...> - 2008-09-23 21:58:33
|
On Sun, 21 Sep 2008 23:22:17 +0200 Marcin Slusarz <mar...@gm...> wrote: > On Sun, Sep 21, 2008 at 08:37:57PM +0200, Krzysztof Helt wrote: > > On Sun, 21 Sep 2008 18:00:08 +0200 > > Marcin Slusarz <mar...@gm...> wrote: > > > > > Join multiple scr_memcpyw into 1-3 calls (usually 2). > > > (benchmarked average speedup: 1%) > > > > > > > The scr_memcpyw is an inline function so there is no real call here. > > ... or it's defined to memcpy > > > However, have you tested the patch with scroll range > 2 * vgacon_scrollback_size? > > > > It seems that your patch only handles scrolling if it is not bigger than 2 * vgacon_scrollback_size. > > No. count is always within range <0, c->vc_rows> (look how it's computed > just before this loop). Second copy is needed only when end of screen > crosses end/beginning of scrollback (it's a circular buffer). > This is not what I asked for. If the vgacon_scrollback_cnt is smaller then c->vc_rows it can happen. The answer to my question is that count is always < vgacon_scrollback_cnt (set earlier before checking if it is in the <0,c->vc_rows> range). (...) > > > + if (count) { > > > + int copysize; > > > + count *= c->vc_size_row; > > > + /* how much memory to end of buffer left? */ > > > + copysize = min(count, vgacon_scrollback_size - soff); > > > + scr_memcpyw(d, vgacon_scrollback + soff, copysize); > > > + d += copysize; > > > + count -= copysize; > > > + > > > + if (count) { > > > + copysize = min(count, vgacon_scrollback_size); This line I got confused by. If the count is always smaller then the vgacon_scrollback_cnt before (thus the vgacon_scrollback_size inside the if clause) this line always evaluates to copysize = count here. I thought something more sophisticated was done here. Regards, Krzysztof ---------------------------------------------------------------------- Znajd¼ mieszkanie w Twoim regionie! kliknij >>> http://link.interia.pl/f1f19 |