File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
4140
4241static 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+
4470void 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 );
You can’t perform that action at this time.
0 commit comments