Re: [Linux-fbdev-devel] [PATCH 1/1 2.6.13] framebuffer: bit_putcs()optimization for 8x* fonts

From: Geert Uytterhoeven
Date: Tue Aug 30 2005 - 11:19:26 EST


On Tue, 30 Aug 2005, Knut Petersen wrote:
> linux/drivers/video/console/bitblit.c
> --- linuxorig/drivers/video/console/bitblit.c 2005-08-29 01:41:01.000000000
> +0200
> +++ linux/drivers/video/console/bitblit.c 2005-08-30 17:19:57.000000000
> +0200
> @@ -114,7 +114,7 @@ static void bit_putcs(struct vc_data *vc
> unsigned int scan_align = info->pixmap.scan_align - 1;
> unsigned int buf_align = info->pixmap.buf_align - 1;
> unsigned int shift_low = 0, mod = vc->vc_font.width % 8;
> - unsigned int shift_high = 8, pitch, cnt, size, k;
> + unsigned int shift_high = 8, pitch, cnt, size, i, k;
> unsigned int idx = vc->vc_font.width >> 3;
> unsigned int attribute = get_attribute(info, scr_readw(s));
> struct fb_image image;
> @@ -175,7 +175,11 @@ static void bit_putcs(struct vc_data *vc
> src = buf;
> }
>
> - fb_pad_aligned_buffer(dst, pitch, src, idx,
> image.height);
> + if (idx == 1)
> + for(i=0; i < image.height; i++)
> + dst[pitch*i] = src[i];
^^^^^^^
> + else
> + fb_pad_aligned_buffer(dst, pitch, src,
> idx, image.height);
> dst += width;
> }
> }

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;
}

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
-
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/