Skip to content

Commit 1a78d9a

Browse files
soci64hdeller
authored andcommitted
fbdev: wmt_ge_rops: Remove fb_draw.h includes
Remove dependency on fb_draw.h to allow fbcon packed pixel drawing refactoring. Signed-off-by: Zsolt Kajtar <soci@c64.rulez.org> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent b8389cb commit 1a78d9a

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

drivers/video/fbdev/wmt_ge_rops.c

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <linux/io.h>
1313
#include <linux/platform_device.h>
1414

15-
#include "core/fb_draw.h"
1615
#include "wmt_ge_rops.h"
1716

1817
#define GE_COMMAND_OFF 0x00
@@ -41,6 +40,33 @@
4140

4241
static void __iomem *regbase;
4342

43+
/* from the spec it seems more like depth than bits per pixel */
44+
static inline unsigned long pixel_to_pat(u32 depth, u32 pixel, struct fb_info *p)
45+
{
46+
switch (depth) {
47+
case 1:
48+
return ~0ul*pixel;
49+
case 2:
50+
return ~0ul/3*pixel;
51+
case 4:
52+
return ~0ul/15*pixel;
53+
case 8:
54+
return ~0ul/255*pixel;
55+
case 12:
56+
case 15:
57+
case 16:
58+
return ~0ul/0xffff*pixel;
59+
case 18:
60+
case 24:
61+
return 0x1000001ul*pixel;
62+
case 32:
63+
return pixel;
64+
default:
65+
fb_warn_once(p, "%s: unsupported pixelformat %d\n", __func__, depth);
66+
return 0;
67+
}
68+
}
69+
4470
void wmt_ge_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
4571
{
4672
unsigned long fg, pat;
@@ -54,7 +80,7 @@ void wmt_ge_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
5480
else
5581
fg = rect->color;
5682

57-
pat = pixel_to_pat(p->var.bits_per_pixel, fg);
83+
pat = pixel_to_pat(p->var.bits_per_pixel, fg, p);
5884

5985
if (p->fbops->fb_sync)
6086
p->fbops->fb_sync(p);

0 commit comments

Comments
 (0)