Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57133
b: refs/heads/master
c: a2b7d2e
h: refs/heads/master
i:
  57131: 8df3843
v: v3
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed May 31, 2007
1 parent a1299be commit e4dfa33
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3f0a6766e0cc5a577805732e5adb50a585c58175
refs/heads/master: a2b7d2e97edcad0e95ae0d3c253d3f2f69254fa4
30 changes: 16 additions & 14 deletions trunk/drivers/video/neofb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1286,34 +1286,36 @@ static int neofb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
if (regno >= fb->cmap.len || regno > 255)
return -EINVAL;

switch (fb->var.bits_per_pixel) {
case 8:
if (fb->var.bits_per_pixel <= 8) {
outb(regno, 0x3c8);

outb(red >> 10, 0x3c9);
outb(green >> 10, 0x3c9);
outb(blue >> 10, 0x3c9);
break;
case 16:
((u32 *) fb->pseudo_palette)[regno] =
} else if (regno < 16) {
switch (fb->var.bits_per_pixel) {
case 16:
((u32 *) fb->pseudo_palette)[regno] =
((red & 0xf800)) | ((green & 0xfc00) >> 5) |
((blue & 0xf800) >> 11);
break;
case 24:
((u32 *) fb->pseudo_palette)[regno] =
break;
case 24:
((u32 *) fb->pseudo_palette)[regno] =
((red & 0xff00) << 8) | ((green & 0xff00)) |
((blue & 0xff00) >> 8);
break;
break;
#ifdef NO_32BIT_SUPPORT_YET
case 32:
((u32 *) fb->pseudo_palette)[regno] =
case 32:
((u32 *) fb->pseudo_palette)[regno] =
((transp & 0xff00) << 16) | ((red & 0xff00) << 8) |
((green & 0xff00)) | ((blue & 0xff00) >> 8);
break;
break;
#endif
default:
return 1;
default:
return 1;
}
}

return 0;
}

Expand Down

0 comments on commit e4dfa33

Please sign in to comment.