aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/cfbcopyarea.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/cfbcopyarea.c')
-rw-r--r--drivers/video/cfbcopyarea.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/video/cfbcopyarea.c b/drivers/video/cfbcopyarea.c
index b07e419b12d2..df03f3776dcc 100644
--- a/drivers/video/cfbcopyarea.c
+++ b/drivers/video/cfbcopyarea.c
@@ -44,15 +44,16 @@
44 */ 44 */
45 45
46static void 46static void
47bitcpy(unsigned long __iomem *dst, int dst_idx, const unsigned long __iomem *src, 47bitcpy(struct fb_info *p, unsigned long __iomem *dst, int dst_idx,
48 int src_idx, int bits, unsigned n, u32 bswapmask) 48 const unsigned long __iomem *src, int src_idx, int bits,
49 unsigned n, u32 bswapmask)
49{ 50{
50 unsigned long first, last; 51 unsigned long first, last;
51 int const shift = dst_idx-src_idx; 52 int const shift = dst_idx-src_idx;
52 int left, right; 53 int left, right;
53 54
54 first = fb_shifted_pixels_mask_long(dst_idx, bswapmask); 55 first = fb_shifted_pixels_mask_long(p, dst_idx, bswapmask);
55 last = ~fb_shifted_pixels_mask_long((dst_idx+n) % bits, bswapmask); 56 last = ~fb_shifted_pixels_mask_long(p, (dst_idx+n) % bits, bswapmask);
56 57
57 if (!shift) { 58 if (!shift) {
58 // Same alignment for source and dest 59 // Same alignment for source and dest
@@ -202,8 +203,9 @@ bitcpy(unsigned long __iomem *dst, int dst_idx, const unsigned long __iomem *src
202 */ 203 */
203 204
204static void 205static void
205bitcpy_rev(unsigned long __iomem *dst, int dst_idx, const unsigned long __iomem *src, 206bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, int dst_idx,
206 int src_idx, int bits, unsigned n, u32 bswapmask) 207 const unsigned long __iomem *src, int src_idx, int bits,
208 unsigned n, u32 bswapmask)
207{ 209{
208 unsigned long first, last; 210 unsigned long first, last;
209 int shift; 211 int shift;
@@ -221,8 +223,9 @@ bitcpy_rev(unsigned long __iomem *dst, int dst_idx, const unsigned long __iomem
221 223
222 shift = dst_idx-src_idx; 224 shift = dst_idx-src_idx;
223 225
224 first = fb_shifted_pixels_mask_long(bits - 1 - dst_idx, bswapmask); 226 first = fb_shifted_pixels_mask_long(p, bits - 1 - dst_idx, bswapmask);
225 last = ~fb_shifted_pixels_mask_long(bits - 1 - ((dst_idx-n) % bits), bswapmask); 227 last = ~fb_shifted_pixels_mask_long(p, bits - 1 - ((dst_idx-n) % bits),
228 bswapmask);
226 229
227 if (!shift) { 230 if (!shift) {
228 // Same alignment for source and dest 231 // Same alignment for source and dest
@@ -404,7 +407,7 @@ void cfb_copyarea(struct fb_info *p, const struct fb_copyarea *area)
404 dst_idx &= (bytes - 1); 407 dst_idx &= (bytes - 1);
405 src += src_idx >> (ffs(bits) - 1); 408 src += src_idx >> (ffs(bits) - 1);
406 src_idx &= (bytes - 1); 409 src_idx &= (bytes - 1);
407 bitcpy_rev(dst, dst_idx, src, src_idx, bits, 410 bitcpy_rev(p, dst, dst_idx, src, src_idx, bits,
408 width*p->var.bits_per_pixel, bswapmask); 411 width*p->var.bits_per_pixel, bswapmask);
409 } 412 }
410 } else { 413 } else {
@@ -413,7 +416,7 @@ void cfb_copyarea(struct fb_info *p, const struct fb_copyarea *area)
413 dst_idx &= (bytes - 1); 416 dst_idx &= (bytes - 1);
414 src += src_idx >> (ffs(bits) - 1); 417 src += src_idx >> (ffs(bits) - 1);
415 src_idx &= (bytes - 1); 418 src_idx &= (bytes - 1);
416 bitcpy(dst, dst_idx, src, src_idx, bits, 419 bitcpy(p, dst, dst_idx, src, src_idx, bits,
417 width*p->var.bits_per_pixel, bswapmask); 420 width*p->var.bits_per_pixel, bswapmask);
418 dst_idx += bits_per_line; 421 dst_idx += bits_per_line;
419 src_idx += bits_per_line; 422 src_idx += bits_per_line;