diff options
author | Paul Mackerras <paulus@samba.org> | 2006-02-28 06:35:24 +0100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-02-28 06:35:24 +0100 |
commit | 6749c5507388f3fc3719f57a54b540ee83f6661a (patch) | |
tree | c069f990f86b020a14b50759d0c75475eedde186 /drivers/video/asiliantfb.c | |
parent | powerpc: Export variables used in conversions to/from cputime_t (diff) | |
parent | [PATCH] powerpc/iseries: Fix double phys_to_abs bug in htab_bolt_mapping (diff) | |
download | linux-6749c5507388f3fc3719f57a54b540ee83f6661a.tar.xz linux-6749c5507388f3fc3719f57a54b540ee83f6661a.zip |
Merge ../powerpc-merge
Diffstat (limited to 'drivers/video/asiliantfb.c')
-rw-r--r-- | drivers/video/asiliantfb.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/video/asiliantfb.c b/drivers/video/asiliantfb.c index 69f75547865d..c924d81f7978 100644 --- a/drivers/video/asiliantfb.c +++ b/drivers/video/asiliantfb.c @@ -322,32 +322,29 @@ static int asiliantfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, writeb(green, mmio_base + 0x791); writeb(blue, mmio_base + 0x791); - switch(p->var.bits_per_pixel) { - case 15: - if (regno < 16) { + if (regno < 16) { + switch(p->var.red.offset) { + case 10: /* RGB 555 */ ((u32 *)(p->pseudo_palette))[regno] = ((red & 0xf8) << 7) | ((green & 0xf8) << 2) | ((blue & 0xf8) >> 3); - } - break; - case 16: - if (regno < 16) { + break; + case 11: /* RGB 565 */ ((u32 *)(p->pseudo_palette))[regno] = ((red & 0xf8) << 8) | ((green & 0xfc) << 3) | ((blue & 0xf8) >> 3); - } - break; - case 24: - if (regno < 24) { + break; + case 16: /* RGB 888 */ ((u32 *)(p->pseudo_palette))[regno] = (red << 16) | (green << 8) | (blue); + break; } - break; } + return 0; } |