From: James S. <jsi...@us...> - 2002-03-11 21:37:26
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv1966 Modified Files: cfbimgblt.c Log Message: Fixed soft accel image drawing function. Fonts work at 8,16,32 bpp. Index: cfbimgblt.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/cfbimgblt.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- cfbimgblt.c 6 Mar 2002 23:05:56 -0000 1.8 +++ cfbimgblt.c 11 Mar 2002 21:37:23 -0000 1.9 @@ -43,13 +43,12 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image) { - unsigned long end_index, end_mask, mask, eorx; - int ppw, shift, shift_right, shift_left, x2, y2, n, i, j, k, l; - int linesize = p->fix.line_length; - unsigned long fgx, bgx, fgcolor, bgcolor; - unsigned long *dst, *src = NULL; - long tmp = -1 >> (BITS_PER_LONG - p->var.bits_per_pixel); - u8 *dst1, *src1; + int ppw, shift, shift_right, shift_left, x2, y2, n, i, j, k, l = 7; + unsigned long tmp = ~0 << (BITS_PER_LONG - p->var.bits_per_pixel); + unsigned long fgx, bgx, fgcolor, bgcolor, eorx; + unsigned long end_index, end_mask, mask; + unsigned long *dst = NULL; + u8 *dst1, *src; /* * We could use hardware clipping but on many cards you get around hardware @@ -64,12 +63,12 @@ image->width = x2 - image->dx; image->height = y2 - image->dy; - dst1 = p->screen_base + image->dy * linesize + + dst1 = p->screen_base + image->dy * p->fix.line_length + ((image->dx * p->var.bits_per_pixel) >> 3); ppw = BITS_PER_LONG/p->var.bits_per_pixel; - src1 = image->data; + src = image->data; if (p->fix.visual == FB_VISUAL_TRUECOLOR) { fgx = fgcolor = ((u32 *)(p->pseudo_palette))[image->fg_color]; @@ -86,18 +85,19 @@ bgx |= bgcolor; } eorx = fgx ^ bgx; - l = 8; + l = 7; for (i = 0; i < image->height; i++) { dst = (unsigned long *) dst1; for (j = image->width/ppw; j > 0; j--) { mask = 0; - for (k = ppw; k > 0; k--) { - if (test_bit(l, src1)) - mask |= (tmp << (p->var.bits_per_pixel*(ppw-k))); + + for (k = ppw; k > 0; k--) { + if (test_bit(l, src)) + mask |= (tmp >> (p->var.bits_per_pixel*(k-1))); l--; - if (!l) { l = 8; src1++; } + if (l < 0) { l = 7; src++; } } fb_writel((mask & eorx)^bgx, dst); dst++; |