14 #include <linux/string.h>
15 #include <linux/module.h>
17 #include <linux/slab.h>
31 0x0000, 0xaaaa, 0x5555, 0xffff
34 0x0000, 0xaaaa, 0x5555, 0xffff
37 0x0000, 0xaaaa, 0x5555, 0xffff
41 0x0000, 0x0000, 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa
44 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0x0000, 0x0000, 0x5555, 0xaaaa
47 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa
51 0x0000, 0x0000, 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa,
52 0x5555, 0x5555, 0x5555, 0x5555, 0xffff, 0xffff, 0xffff, 0xffff
55 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0x0000, 0x0000, 0x5555, 0xaaaa,
56 0x5555, 0x5555, 0xffff, 0xffff, 0x5555, 0x5555, 0xffff, 0xffff
59 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa,
60 0x5555, 0xffff, 0x5555, 0xffff, 0x5555, 0xffff, 0x5555, 0xffff
63 static const struct fb_cmap default_2_colors = {
64 .len=2, .red=red2, .green=green2, .blue=blue2
66 static const struct fb_cmap default_8_colors = {
67 .len=8, .red=red8, .green=green8, .blue=blue8
69 static const struct fb_cmap default_4_colors = {
70 .len=4, .red=red4, .green=green4, .blue=blue4
72 static const struct fb_cmap default_16_colors = {
73 .len=16, .red=red16, .green=green16, .blue=blue16
97 if (cmap->
len != len) {
166 int tooff = 0, fromoff = 0;
173 size = to->
len - tooff;
174 if (size > (
int) (from->
len - fromoff))
175 size = from->
len - fromoff;
190 int tooff = 0, fromoff = 0;
197 size = to->
len - tooff;
198 if (size > (
int) (from->
len - fromoff))
199 size = from->
len - fromoff;
231 u_int hred, hgreen, hblue, htransp = 0xffff;
239 if (start < 0 || (!info->
fbops->fb_setcolreg &&
240 !info->
fbops->fb_setcmap))
242 if (info->
fbops->fb_setcmap) {
243 rc = info->
fbops->fb_setcmap(cmap, info);
245 for (i = 0; i < cmap->
len; i++) {
251 if (info->
fbops->fb_setcolreg(start++,
268 if (size < 0 || size < cmap->
len)
288 if (cmap->
start < 0 || (!info->
fbops->fb_setcolreg &&
289 !info->
fbops->fb_setcmap)) {
295 unlock_fb_info(info);
315 return &default_2_colors;
317 return &default_4_colors;
319 return &default_8_colors;
320 return &default_16_colors;
337 green2[
i] = ~green2[
i];
338 blue2[
i] = ~blue2[
i];
342 green4[
i] = ~green4[
i];
343 blue4[
i] = ~blue4[
i];
347 green8[
i] = ~green8[
i];
348 blue8[
i] = ~blue8[
i];
351 red16[
i] = ~red16[
i];
352 green16[
i] = ~green16[
i];
353 blue16[
i] = ~blue16[
i];