From 829e79b680210c4f4de435af6e1f90451922fc7d Mon Sep 17 00:00:00 2001 From: Antonino A. Daplas Date: Fri, 9 Sep 2005 13:10:04 -0700 Subject: [PATCH] fbcon: Break up bit_putcs into its component functions The function bit_putcs() in drivers/video/console/bitblit.c is becoming large. Break it up into its component functions (bit_putcs_unaligned and bit_putcs_aligned). Incorporated fb_pad_aligned_buffer() optimization by Roman Zippel. Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fb.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/linux/fb.h') diff --git a/include/linux/fb.h b/include/linux/fb.h index 9a4f035e9fdc..82e39cd0c4fb 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -833,6 +833,21 @@ extern int fb_new_modelist(struct fb_info *info); extern struct fb_info *registered_fb[FB_MAX]; extern int num_registered_fb; +static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, + u8 *src, u32 s_pitch, u32 height) +{ + 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++ = *src++; + dst += d_pitch; + } +} + /* drivers/video/fbsysfs.c */ extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev); extern void framebuffer_release(struct fb_info *info); -- cgit v1.2.3-55-g7522