Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 60910
b: refs/heads/master
c: 973d9ab
h: refs/heads/master
v: v3
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Jul 17, 2007
1 parent 2715e08 commit 90f4108
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: eb3daa83c2f63743fb7597f620beac75e1ba5633
refs/heads/master: 973d9ab231a6b9feb1ff5b9a072f11756eca96cc
30 changes: 16 additions & 14 deletions trunk/drivers/video/tridentfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,27 +976,29 @@ static int tridentfb_setcolreg(unsigned regno, unsigned red, unsigned green,
return 1;


if (bpp==8) {
if (bpp == 8) {
t_outb(0xFF,0x3C6);
t_outb(regno,0x3C8);

t_outb(red>>10,0x3C9);
t_outb(green>>10,0x3C9);
t_outb(blue>>10,0x3C9);

} else if (bpp == 16) { /* RGB 565 */
u32 col;

col = (red & 0xF800) | ((green & 0xFC00) >> 5) |
((blue & 0xF800) >> 11);
col |= col << 16;
((u32 *)(info->pseudo_palette))[regno] = col;
} else if (bpp == 32) /* ARGB 8888 */
((u32*)info->pseudo_palette)[regno] =
((transp & 0xFF00) <<16) |
((red & 0xFF00) << 8) |
((green & 0xFF00)) |
((blue & 0xFF00)>>8);
} else if (regno < 16) {
if (bpp == 16) { /* RGB 565 */
u32 col;

col = (red & 0xF800) | ((green & 0xFC00) >> 5) |
((blue & 0xF800) >> 11);
col |= col << 16;
((u32 *)(info->pseudo_palette))[regno] = col;
} else if (bpp == 32) /* ARGB 8888 */
((u32*)info->pseudo_palette)[regno] =
((transp & 0xFF00) <<16) |
((red & 0xFF00) << 8) |
((green & 0xFF00)) |
((blue & 0xFF00)>>8);
}

// debug("exit\n");
return 0;
Expand Down

0 comments on commit 90f4108

Please sign in to comment.