summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2005-12-12 22:17:20 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-12 22:31:17 -0800
commit7275b4b6bc2f783c135c3f0eeecc4fdc6e788aa8 (patch)
treebe75b6de5a19263ffbc54068251988b3d7e2b754 /drivers/video
parent39942fd8ff57c8623451bbfaffe8a184cc8b463a (diff)
downloadop-kernel-dev-7275b4b6bc2f783c135c3f0eeecc4fdc6e788aa8.zip
op-kernel-dev-7275b4b6bc2f783c135c3f0eeecc4fdc6e788aa8.tar.gz
[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')
-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 a7770c4..7a01742 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 *
u32 i, j, l;
dst2 = (u32 __iomem *) dst1;
+ fgcolor <<= LEFT_POS(bpp);
+ bgcolor <<= LEFT_POS(bpp);
for (i = image->height; i--; ) {
shift = val = 0;
@@ -180,7 +182,6 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info *
while (j--) {
l--;
color = (*s & 1 << (BIT_NR(l))) ? fgcolor : bgcolor;
- color <<= LEFT_POS(bpp);
val |= SHIFT_HIGH(color, shift);
/* Did the bitshift spill bits to the next long? */
OpenPOWER on IntegriCloud