16 #include <linux/module.h>
17 #include <linux/string.h>
19 #include <asm/types.h>
22 #if BITS_PER_LONG == 32
23 # define FB_WRITEL fb_writel
24 # define FB_READL fb_readl
26 # define FB_WRITEL fb_writeq
27 # define FB_READL fb_readq
36 unsigned long pat,
unsigned n,
int bits,
u32 bswapmask)
46 if (dst_idx+n <= bits) {
103 if (dst_idx+n <= bits) {
146 bitfill_aligned_rev(
struct fb_info *p,
unsigned long __iomem *dst,
147 int dst_idx,
unsigned long pat,
unsigned n,
int bits,
150 unsigned long val = pat,
dat;
151 unsigned long first, last;
159 if (dst_idx+n <= bits) {
164 FB_WRITEL(comp(dat ^ val, dat, first), dst);
170 FB_WRITEL(comp(dat ^ val, dat, first), dst);
203 FB_WRITEL(comp(dat ^ val, dat, last), dst);
217 bitfill_unaligned_rev(
struct fb_info *p,
unsigned long __iomem *dst,
218 int dst_idx,
unsigned long pat,
int left,
int right,
219 unsigned n,
int bits)
229 if (dst_idx+n <= bits) {
234 FB_WRITEL(comp(dat ^ pat, dat, first), dst);
241 FB_WRITEL(comp(dat ^ pat, dat, first), dst);
273 FB_WRITEL(comp(dat ^ pat, dat, last), dst);
280 unsigned long pat, pat2, fg;
296 pat = pixel_to_pat(bpp, fg);
300 dst_idx += rect->
dy*p->
fix.line_length*8+rect->
dx*
bpp;
303 if (p->
fbops->fb_sync)
304 p->
fbops->fb_sync(p);
309 unsigned long pat,
unsigned n,
int bits,
314 fill_op32 = bitfill_aligned_rev;
317 fill_op32 = bitfill_aligned;
320 printk(
KERN_ERR "cfb_fillrect(): unknown rop, defaulting to ROP_COPY\n");
321 fill_op32 = bitfill_aligned;
325 dst += dst_idx >> (
ffs(bits) - 1);
326 dst_idx &= (bits - 1);
327 fill_op32(p, dst, dst_idx, pat, width*bpp, bits,
329 dst_idx += p->
fix.line_length*8;
334 int dst_idx,
unsigned long pat,
int left,
336 #ifdef __LITTLE_ENDIAN
344 fill_op = bitfill_unaligned_rev;
347 fill_op = bitfill_unaligned;
350 printk(
KERN_ERR "cfb_fillrect(): unknown rop, defaulting to ROP_COPY\n");
351 fill_op = bitfill_unaligned;
355 dst += dst_idx /
bits;
356 dst_idx &= (bits - 1);
360 fill_op(p, dst, dst_idx, pat2, left, right,
362 dst_idx += p->
fix.line_length*8;