Skip to content

Commit

Permalink
[PATCH] fbdev: Shift pixel value before entering loop in cfbimageblit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Dec 13, 2005
1 parent 39942fd commit 7275b4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/video/cfbimgblt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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? */
Expand Down

0 comments on commit 7275b4b

Please sign in to comment.