Thread (16 messages) 16 messages, 4 authors, 2005-08-31

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

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2005-08-30 16:19:04
Also in: lkml

On Tue, 30 Aug 2005, Knut Petersen wrote:
quoted hunk ↗ jump to hunk
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@linux-m68k.org

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


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help