aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/cfbimgblt.c
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2005-12-13 01:17:20 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-13 01:31:17 -0500
commit7275b4b6bc2f783c135c3f0eeecc4fdc6e788aa8 (patch)
treebe75b6de5a19263ffbc54068251988b3d7e2b754 /drivers/video/cfbimgblt.c
parent39942fd8ff57c8623451bbfaffe8a184cc8b463a (diff)
[PATCH] fbdev: Shift pixel value before entering loop in cfbimageblit
In slow imageblit, the pixel value is shifted by a certain amount (dependent on the bpp and endianness) for each iteration. This is inefficient. Better do the shifting once before going into the loop. Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/cfbimgblt.c')
-rw-r--r--drivers/video/cfbimgblt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/video/cfbimgblt.c b/drivers/video/cfbimgblt.c
index a7770c4f17d0..7a01742a82af 100644
--- a/drivers/video/cfbimgblt.c
+++ b/drivers/video/cfbimgblt.c
@@ -162,6 +162,8 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info *
162 u32 i, j, l; 162 u32 i, j, l;
163 163
164 dst2 = (u32 __iomem *) dst1; 164 dst2 = (u32 __iomem *) dst1;
165 fgcolor <<= LEFT_POS(bpp);
166 bgcolor <<= LEFT_POS(bpp);
165 167
166 for (i = image->height; i--; ) { 168 for (i = image->height; i--; ) {
167 shift = val = 0; 169 shift = val = 0;
@@ -180,7 +182,6 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info *
180 while (j--) { 182 while (j--) {
181 l--; 183 l--;
182 color = (*s & 1 << (BIT_NR(l))) ? fgcolor : bgcolor; 184 color = (*s & 1 << (BIT_NR(l))) ? fgcolor : bgcolor;
183 color <<= LEFT_POS(bpp);
184 val |= SHIFT_HIGH(color, shift); 185 val |= SHIFT_HIGH(color, shift);
185 186
186 /* Did the bitshift spill bits to the next long? */ 187 /* Did the bitshift spill bits to the next long? */