diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-05-11 14:44:27 +0200 | 
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-05-11 14:44:31 +0200 | 
| commit | 41fb454ebe6024f5c1e3b3cbc0abc0da762e7b51 (patch) | |
| tree | 51c50bcb67a5039448ddfa1869d7948cab1217e9 /drivers/video/sysfillrect.c | |
| parent | 19c1a6f5764d787113fa323ffb18be7991208f82 (diff) | |
| parent | 091bf7624d1c90cec9e578a18529f615213ff847 (diff) | |
Merge commit 'v2.6.30-rc5' into core/iommu
Merge reason: core/iommu was on an .30-rc1 base,
              update it to .30-rc5 to refresh.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/video/sysfillrect.c')
| -rw-r--r-- | drivers/video/sysfillrect.c | 30 | 
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/video/sysfillrect.c b/drivers/video/sysfillrect.c index f94d6b6e29e..33ee3d34f9d 100644 --- a/drivers/video/sysfillrect.c +++ b/drivers/video/sysfillrect.c @@ -124,7 +124,7 @@ bitfill_unaligned(struct fb_info *p, unsigned long *dst, int dst_idx,  		/* Trailing bits */  		if (last) -			*dst = comp(pat, *dst, first); +			*dst = comp(pat, *dst, last);  	}  } @@ -242,7 +242,7 @@ bitfill_unaligned_rev(struct fb_info *p, unsigned long *dst, int dst_idx,  void sys_fillrect(struct fb_info *p, const struct fb_fillrect *rect)  { -	unsigned long pat, fg; +	unsigned long pat, pat2, fg;  	unsigned long width = rect->width, height = rect->height;  	int bits = BITS_PER_LONG, bytes = bits >> 3;  	u32 bpp = p->var.bits_per_pixel; @@ -292,17 +292,16 @@ void sys_fillrect(struct fb_info *p, const struct fb_fillrect *rect)  			dst_idx += p->fix.line_length*8;  		}  	} else { -		int right; -		int r; -		int rot = (left-dst_idx) % bpp; +		int right, r;  		void (*fill_op)(struct fb_info *p, unsigned long *dst,  				int dst_idx, unsigned long pat, int left,  				int right, unsigned n, int bits) = NULL; - -		/* rotate pattern to correct start position */ -		pat = pat << rot | pat >> (bpp-rot); - -		right = bpp-left; +#ifdef __LITTLE_ENDIAN +		right = left; +		left = bpp - right; +#else +		right = bpp - left; +#endif  		switch (rect->rop) {  		case ROP_XOR:  			fill_op = bitfill_unaligned_rev; @@ -311,18 +310,19 @@ void sys_fillrect(struct fb_info *p, const struct fb_fillrect *rect)  			fill_op = bitfill_unaligned;  			break;  		default: -			printk(KERN_ERR "cfb_fillrect(): unknown rop, " +			printk(KERN_ERR "sys_fillrect(): unknown rop, "  				"defaulting to ROP_COPY\n");  			fill_op = bitfill_unaligned;  			break;  		}  		while (height--) { -			dst += dst_idx >> (ffs(bits) - 1); +			dst += dst_idx / bits;  			dst_idx &= (bits - 1); -			fill_op(p, dst, dst_idx, pat, left, right, +			r = dst_idx % bpp; +			/* rotate pattern to the correct start position */ +			pat2 = le_long_to_cpu(rolx(cpu_to_le_long(pat), r, bpp)); +			fill_op(p, dst, dst_idx, pat2, left, right,  				width*bpp, bits); -			r = (p->fix.line_length*8) % bpp; -			pat = pat << (bpp-r) | pat >> r;  			dst_idx += p->fix.line_length*8;  		}  	}  | 
