From: James S. <jsi...@us...> - 2002-05-06 19:04:32
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv26902 Modified Files: cfbfillrect.c Log Message: Fixed the issue of off by a pixels for the cursor. Index: cfbfillrect.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/cfbfillrect.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- cfbfillrect.c 23 Mar 2002 00:22:58 -0000 1.9 +++ cfbfillrect.c 6 May 2002 19:04:28 -0000 1.10 @@ -20,6 +20,7 @@ #include <linux/string.h> #include <linux/fb.h> #include <asm/types.h> +#include <video/fbcon.h> void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect) { @@ -42,10 +43,10 @@ height = y2 - rect->dy; /* Size of the scanline in bytes */ - n = ((rect->width * p->var.bits_per_pixel) >> 3); + n = (rect->width * (p->var.bits_per_pixel >> 3)); ppw = BITS_PER_LONG/p->var.bits_per_pixel; - dst1 = p->screen_base + rect->dy * linesize + ((rect->dx * p->var.bits_per_pixel) >> 3); + dst1 = p->screen_base + (rect->dy * linesize) + (rect->dx * (p->var.bits_per_pixel >> 3)); start_index = ((unsigned long) dst1 & (bpl-1)); end_index = ((unsigned long)(dst1 + n) & (bpl-1)); @@ -114,27 +115,31 @@ fb_writeq(fb_readq(dst) | end_mask, dst); #endif dst1+=linesize; - } while (--height); - break; + } while (--height); + break; case ROP_XOR: do { dst = (unsigned long *) (dst1 - start_index); + + if (start_mask) { #if BITS_PER_LONG == 32 - fb_writel(fb_readl(dst) ^ start_mask, dst); + fb_writel(fb_readl(dst) ^ start_mask, dst); #else - fb_writeq(fb_readq(dst) ^ start_mask, dst); + fb_writeq(fb_readq(dst) ^ start_mask, dst); #endif - for( i=0; i < n; i++) { dst++; + } + + for( i=0; i < n; i++) { #if BITS_PER_LONG == 32 fb_writel(fb_readl(dst) ^ fg, dst); #else fb_writeq(fb_readq(dst) ^ fg, dst); #endif + dst++; } if (end_mask) { - dst++; #if BITS_PER_LONG == 32 fb_writel(fb_readl(dst) ^ end_mask, dst); #else |