aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/cfbcopyarea.c
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2005-12-13 01:17:21 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-13 01:31:17 -0500
commitbe0d9b6c7aeaad1683059c00131cabd4c894c17c (patch)
treef7e55af855531331113cbddb98688f3901d48425 /drivers/video/cfbcopyarea.c
parent7275b4b6bc2f783c135c3f0eeecc4fdc6e788aa8 (diff)
[PATCH] fbdev: Fix incorrect unaligned access in little-endian machines
The drawing function cfbfillrect does not work correctly when access is not unsigned-long aligned. It manifests as extra lines of pixels that are not complete drawn. Reversing the shift operator solves the problem, so I would presume that this bug would manifest only on little endian machines. The function cfbcopyarea may also have this bug. Aligned access should present no problems. Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/cfbcopyarea.c')
-rw-r--r--drivers/video/cfbcopyarea.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/video/cfbcopyarea.c b/drivers/video/cfbcopyarea.c
index cdc71572cf35..74415325b016 100644
--- a/drivers/video/cfbcopyarea.c
+++ b/drivers/video/cfbcopyarea.c
@@ -64,8 +64,8 @@ bitcpy(unsigned long __iomem *dst, int dst_idx, const unsigned long __iomem *src
64 int const shift = dst_idx-src_idx; 64 int const shift = dst_idx-src_idx;
65 int left, right; 65 int left, right;
66 66
67 first = ~0UL >> dst_idx; 67 first = FB_SHIFT_HIGH(~0UL, dst_idx);
68 last = ~(~0UL >> ((dst_idx+n) % bits)); 68 last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits));
69 69
70 if (!shift) { 70 if (!shift) {
71 // Same alignment for source and dest 71 // Same alignment for source and dest
@@ -216,8 +216,8 @@ bitcpy_rev(unsigned long __iomem *dst, int dst_idx, const unsigned long __iomem
216 216
217 shift = dst_idx-src_idx; 217 shift = dst_idx-src_idx;
218 218
219 first = ~0UL << (bits - 1 - dst_idx); 219 first = FB_SHIFT_LOW(~0UL, bits - 1 - dst_idx);
220 last = ~(~0UL << (bits - 1 - ((dst_idx-n) % bits))); 220 last = ~(FB_SHIFT_LOW(~0UL, bits - 1 - ((dst_idx-n) % bits)));
221 221
222 if (!shift) { 222 if (!shift) {
223 // Same alignment for source and dest 223 // Same alignment for source and dest