aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/sysfillrect.c
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2007-05-08 00:39:08 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 11:15:30 -0700
commitdc0e6e0544f1cb2af44e5d7a7e68acda05dec6fa (patch)
tree7f5d28d54c333c5ba84bb4b4afe3821246696818 /drivers/video/sysfillrect.c
parent52102c07a68a26fe6f8926e6a8497b577655f18a (diff)
fbdev: consolidate common drawing functions into a header file
Consolidate common drawing functions into a single header file. Signed-off-by: Antonino Daplas <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/sysfillrect.c')
-rw-r--r--drivers/video/sysfillrect.c68
1 files changed, 1 insertions, 67 deletions
diff --git a/drivers/video/sysfillrect.c b/drivers/video/sysfillrect.c
index 10de70779a5..a261e9e6a67 100644
--- a/drivers/video/sysfillrect.c
+++ b/drivers/video/sysfillrect.c
@@ -15,73 +15,7 @@
#include <linux/string.h>
#include <linux/fb.h>
#include <asm/types.h>
-
- /*
- * Compose two values, using a bitmask as decision value
- * This is equivalent to (a & mask) | (b & ~mask)
- */
-
-static inline unsigned long
-comp(unsigned long a, unsigned long b, unsigned long mask)
-{
- return ((a ^ b) & mask) ^ b;
-}
-
- /*
- * Create a pattern with the given pixel's color
- */
-
-#if BITS_PER_LONG == 64
-static inline unsigned long
-pixel_to_pat( u32 bpp, u32 pixel)
-{
- switch (bpp) {
- case 1:
- return 0xfffffffffffffffful*pixel;
- case 2:
- return 0x5555555555555555ul*pixel;
- case 4:
- return 0x1111111111111111ul*pixel;
- case 8:
- return 0x0101010101010101ul*pixel;
- case 12:
- return 0x0001001001001001ul*pixel;
- case 16:
- return 0x0001000100010001ul*pixel;
- case 24:
- return 0x0000000001000001ul*pixel;
- case 32:
- return 0x0000000100000001ul*pixel;
- default:
- panic("pixel_to_pat(): unsupported pixelformat\n");
- }
-}
-#else
-static inline unsigned long
-pixel_to_pat( u32 bpp, u32 pixel)
-{
- switch (bpp) {
- case 1:
- return 0xfffffffful*pixel;
- case 2:
- return 0x55555555ul*pixel;
- case 4:
- return 0x11111111ul*pixel;
- case 8:
- return 0x01010101ul*pixel;
- case 12:
- return 0x00001001ul*pixel;
- case 16:
- return 0x00010001ul*pixel;
- case 24:
- return 0x00000001ul*pixel;
- case 32:
- return 0x00000001ul*pixel;
- default:
- panic("pixel_to_pat(): unsupported pixelformat\n");
- }
-}
-#endif
+#include "fb_draw.h"
/*
* Aligned pattern fill using 32/64-bit memory accesses