]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/cfbfillrect.c
ehci-fsl: add PPC_MPC837x to default y
[linux-2.6-omap-h63xx.git] / drivers / video / cfbfillrect.c
index 71623b4f8ca26581dbf4f8258734685fbd55e079..23d70a12e4daa273bbb16280d3c8f26c682901f2 100644 (file)
      */
 
 static void
-bitfill_aligned(unsigned long __iomem *dst, int dst_idx, unsigned long pat, unsigned n, int bits)
+bitfill_aligned(unsigned long __iomem *dst, int dst_idx, unsigned long pat,
+               unsigned n, int bits, u32 bswapmask)
 {
        unsigned long first, last;
 
        if (!n)
                return;
 
-       first = FB_SHIFT_HIGH(~0UL, dst_idx);
-       last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits));
+       first = fb_shifted_pixels_mask_long(dst_idx, bswapmask);
+       last = ~fb_shifted_pixels_mask_long((dst_idx+n) % bits, bswapmask);
 
        if (dst_idx+n <= bits) {
                // Single word
@@ -146,7 +147,8 @@ bitfill_unaligned(unsigned long __iomem *dst, int dst_idx, unsigned long pat,
      *  Aligned pattern invert using 32/64-bit memory accesses
      */
 static void
-bitfill_aligned_rev(unsigned long __iomem *dst, int dst_idx, unsigned long pat, unsigned n, int bits)
+bitfill_aligned_rev(unsigned long __iomem *dst, int dst_idx, unsigned long pat,
+               unsigned n, int bits, u32 bswapmask)
 {
        unsigned long val = pat, dat;
        unsigned long first, last;
@@ -154,8 +156,8 @@ bitfill_aligned_rev(unsigned long __iomem *dst, int dst_idx, unsigned long pat,
        if (!n)
                return;
 
-       first = FB_SHIFT_HIGH(~0UL, dst_idx);
-       last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits));
+       first = fb_shifted_pixels_mask_long(dst_idx, bswapmask);
+       last = ~fb_shifted_pixels_mask_long((dst_idx+n) % bits, bswapmask);
 
        if (dst_idx+n <= bits) {
                // Single word
@@ -303,8 +305,10 @@ void cfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
        if (p->fbops->fb_sync)
                p->fbops->fb_sync(p);
        if (!left) {
+               u32 bswapmask = fb_compute_bswapmask(p);
                void (*fill_op32)(unsigned long __iomem *dst, int dst_idx,
-                                 unsigned long pat, unsigned n, int bits) = NULL;
+                                 unsigned long pat, unsigned n, int bits,
+                                 u32 bswapmask) = NULL;
 
                switch (rect->rop) {
                case ROP_XOR:
@@ -321,7 +325,7 @@ void cfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
                while (height--) {
                        dst += dst_idx >> (ffs(bits) - 1);
                        dst_idx &= (bits - 1);
-                       fill_op32(dst, dst_idx, pat, width*bpp, bits);
+                       fill_op32(dst, dst_idx, pat, width*bpp, bits, bswapmask);
                        dst_idx += p->fix.line_length*8;
                }
        } else {