diff options
author | Knut Petersen <Knut_Petersen@t-online.de> | 2005-09-09 16:04:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 16:58:02 -0400 |
commit | c5eb5c1ea919f3f717236c5d0892f9c37f19de37 (patch) | |
tree | 33e48218a7a49576120876a09ead5f1366576861 /drivers | |
parent | 9fa68eae9f8291a98bfe00b94b78f72eb253165a (diff) |
[PATCH] framebuffer: bit_putcs() optimization for 8x* fonts
This trivial patch gives a performance boost to the framebuffer console
Constructing the bitmaps that are given to the bitblit functions of the
framebuffer drivers is time consuming. Here we avoide a call to the slow
fb_pad_aligned_buffer(). The patch replaces that call with a simple but
much more efficient bytewise copy.
The kernel spends a significant time at this place if you use 8x* fonts.
Every pixel displayed on your screen is prepared here.
Some benchmark results:
Displaying a file of 2000 lines with 160 characters each takes 889 ms
system time using cyblafb on my system (I´m using a 1280x1024 video mode,
resulting in a 160x64 character console)
Displaying the same file with the enclosed patch applied to 2.6.13 only
takes 760 ms system time, saving 129 ms or 14.5%.
Font widths other than 8 are not affected.
The advantage and correctness of this patch should be obvious.
Signed-off-by: Knut Petersen <Knut_Petersen@t-online.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/console/bitblit.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/video/console/bitblit.c b/drivers/video/console/bitblit.c index 12eaf0aa87e6..6550875ef9c5 100644 --- a/drivers/video/console/bitblit.c +++ b/drivers/video/console/bitblit.c | |||
@@ -114,7 +114,7 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info, | |||
114 | unsigned int scan_align = info->pixmap.scan_align - 1; | 114 | unsigned int scan_align = info->pixmap.scan_align - 1; |
115 | unsigned int buf_align = info->pixmap.buf_align - 1; | 115 | unsigned int buf_align = info->pixmap.buf_align - 1; |
116 | unsigned int shift_low = 0, mod = vc->vc_font.width % 8; | 116 | unsigned int shift_low = 0, mod = vc->vc_font.width % 8; |
117 | unsigned int shift_high = 8, pitch, cnt, size, k; | 117 | unsigned int shift_high = 8, pitch, cnt, size, i, k; |
118 | unsigned int idx = vc->vc_font.width >> 3; | 118 | unsigned int idx = vc->vc_font.width >> 3; |
119 | unsigned int attribute = get_attribute(info, scr_readw(s)); | 119 | unsigned int attribute = get_attribute(info, scr_readw(s)); |
120 | struct fb_image image; | 120 | struct fb_image image; |
@@ -175,7 +175,11 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info, | |||
175 | src = buf; | 175 | src = buf; |
176 | } | 176 | } |
177 | 177 | ||
178 | fb_pad_aligned_buffer(dst, pitch, src, idx, image.height); | 178 | if (idx == 1) |
179 | for(i=0; i < image.height; i++) | ||
180 | dst[pitch*i] = src[i]; | ||
181 | else | ||
182 | fb_pad_aligned_buffer(dst, pitch, src, idx, image.height); | ||
179 | dst += width; | 183 | dst += width; |
180 | } | 184 | } |
181 | } | 185 | } |