提交 7275b4b6 编写于 作者: A Antonino A. Daplas 提交者: Linus Torvalds

[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: NAntonino Daplas <adaplas@pol.net>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 39942fd8
...@@ -162,6 +162,8 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info * ...@@ -162,6 +162,8 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info *
u32 i, j, l; u32 i, j, l;
dst2 = (u32 __iomem *) dst1; dst2 = (u32 __iomem *) dst1;
fgcolor <<= LEFT_POS(bpp);
bgcolor <<= LEFT_POS(bpp);
for (i = image->height; i--; ) { for (i = image->height; i--; ) {
shift = val = 0; shift = val = 0;
...@@ -180,7 +182,6 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info * ...@@ -180,7 +182,6 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info *
while (j--) { while (j--) {
l--; l--;
color = (*s & 1 << (BIT_NR(l))) ? fgcolor : bgcolor; color = (*s & 1 << (BIT_NR(l))) ? fgcolor : bgcolor;
color <<= LEFT_POS(bpp);
val |= SHIFT_HIGH(color, shift); val |= SHIFT_HIGH(color, shift);
/* Did the bitshift spill bits to the next long? */ /* Did the bitshift spill bits to the next long? */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册