@@ -6,7 +6,6 @@
#include <linux/fb.h>
#include <linux/init.h>
#include <linux/string.h>
-#include "../core/fb_draw.h"
#include <asm/io.h>
@@ -57,6 +56,12 @@
* definitation and CUR_VERT_POSN must be saturated to zero.
*/
+/* compose pixels based on mask */
+static inline unsigned long comp(unsigned long set, unsigned long unset, unsigned long mask)
+{
+ return ((set ^ unset) & mask) ^ unset;
+}
+
/*
* Hardware Cursor support.
*/
@@ -12,7 +12,6 @@
#include <linux/io.h>
#include <linux/platform_device.h>
-#include "core/fb_draw.h"
#include "wmt_ge_rops.h"
#define GE_COMMAND_OFF 0x00
@@ -41,6 +40,33 @@
static void __iomem *regbase;
+/* from the spec it seems more like depth than bits per pixel */
+static inline unsigned long pixel_to_pat(u32 depth, u32 pixel, struct fb_info *p)
+{
+ switch (depth) {
+ case 1:
+ return ~0ul*pixel;
+ case 2:
+ return ~0ul/3*pixel;
+ case 4:
+ return ~0ul/15*pixel;
+ case 8:
+ return ~0ul/255*pixel;
+ case 12:
+ case 15:
+ case 16:
+ return ~0ul/0xffff*pixel;
+ case 18:
+ case 24:
+ return 0x1000001ul*pixel;
+ case 32:
+ return pixel;
+ default:
+ fb_warn_once(p, "%s: unsupported pixelformat %d\n", __func__, depth);
+ return 0;
+ }
+}
+
void wmt_ge_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
{
unsigned long fg, pat;
@@ -54,7 +80,7 @@ void wmt_ge_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
else
fg = rect->color;
- pat = pixel_to_pat(p->var.bits_per_pixel, fg);
+ pat = pixel_to_pat(p->var.bits_per_pixel, fg, p);
if (p->fbops->fb_sync)
p->fbops->fb_sync(p);
This is related to the fbcon packed pixel drawing refactoring. There I missed that fb_draw.h was included from two unexpected places. That shouldn't be like that. This patch removes the dependency. Signed-off-by: Zsolt Kajtar <soci@c64.rulez.org> --- drivers/video/fbdev/aty/mach64_cursor.c | 7 +++++- drivers/video/fbdev/wmt_ge_rops.c | 30 +++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-)