lkml.org 
[lkml]   [2005]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [Linux-fbdev-devel] [PATCH 1/1 2.6.13] framebuffer: bit_putcs() optimization for 8x* fonts
    Hi,

    On Tue, 30 Aug 2005, Knut Petersen wrote:

    > > Probably you can make it even faster by avoiding the multiplication, like
    > >
    > > unsigned int offset = 0;
    > > for (i = 0; i < image.height; i++) {
    > > dst[offset] = src[i];
    > > offset += pitch;
    > > }
    > >
    >
    > More than two decades ago I learned to avoid mul and imul. Use shifts, add and
    > lea instead,
    > that was the credo those days. The name of the game was CP/M 80/86, a86, d86
    > and ddt ;-)
    >
    > But let´s get serious again.
    >
    > Your proposed change of the patch results in a 21 ms performance decrease on
    > my system.
    > Yes, I do know that this is hard to believe. I tested a similar variation
    > before, and the results
    > were even worse.

    Could you try the patch below, for a few extra cycles you might want to
    make it an inline function.

    bye, Roman

    Index: linux-2.6/drivers/video/fbmem.c
    ===================================================================
    --- linux-2.6.orig/drivers/video/fbmem.c 2005-08-30 01:55:18.000000000 +0200
    +++ linux-2.6/drivers/video/fbmem.c 2005-08-30 21:10:25.705462837 +0200
    @@ -82,11 +82,11 @@ void fb_pad_aligned_buffer(u8 *dst, u32
    {
    int i, j;

    + d_pitch -= s_pitch;
    for (i = height; i--; ) {
    /* s_pitch is a few bytes at the most, memcpy is suboptimal */
    for (j = 0; j < s_pitch; j++)
    - dst[j] = src[j];
    - src += s_pitch;
    + *dst++ = *src++;
    dst += d_pitch;
    }
    }
    \
     
     \ /
      Last update: 2005-08-30 21:16    [W:0.022 / U:2.204 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site