aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/tdfxfb.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c
index 3e7baf4c9fa8..5e5328d682db 100644
--- a/drivers/video/tdfxfb.c
+++ b/drivers/video/tdfxfb.c
@@ -786,28 +786,32 @@ static int tdfxfb_setcolreg(unsigned regno, unsigned red, unsigned green,
786 if (regno >= info->cmap.len || regno > 255) return 1; 786 if (regno >= info->cmap.len || regno > 255) return 1;
787 787
788 switch (info->fix.visual) { 788 switch (info->fix.visual) {
789 case FB_VISUAL_PSEUDOCOLOR: 789 case FB_VISUAL_PSEUDOCOLOR:
790 rgbcol =(((u32)red & 0xff00) << 8) | 790 rgbcol =(((u32)red & 0xff00) << 8) |
791 (((u32)green & 0xff00) << 0) | 791 (((u32)green & 0xff00) << 0) |
792 (((u32)blue & 0xff00) >> 8); 792 (((u32)blue & 0xff00) >> 8);
793 do_setpalentry(par, regno, rgbcol); 793 do_setpalentry(par, regno, rgbcol);
794 break; 794 break;
795 /* Truecolor has no hardware color palettes. */ 795 /* Truecolor has no hardware color palettes. */
796 case FB_VISUAL_TRUECOLOR: 796 case FB_VISUAL_TRUECOLOR:
797 if (regno < 16) {
797 rgbcol = (CNVT_TOHW( red, info->var.red.length) << 798 rgbcol = (CNVT_TOHW( red, info->var.red.length) <<
798 info->var.red.offset) | 799 info->var.red.offset) |
799 (CNVT_TOHW( green, info->var.green.length) << 800 (CNVT_TOHW( green, info->var.green.length) <<
800 info->var.green.offset) | 801 info->var.green.offset) |
801 (CNVT_TOHW( blue, info->var.blue.length) << 802 (CNVT_TOHW( blue, info->var.blue.length) <<
802 info->var.blue.offset) | 803 info->var.blue.offset) |
803 (CNVT_TOHW( transp, info->var.transp.length) << 804 (CNVT_TOHW( transp, info->var.transp.length) <<
804 info->var.transp.offset); 805 info->var.transp.offset);
805 par->palette[regno] = rgbcol; 806 par->palette[regno] = rgbcol;
806 break; 807 }
807 default: 808
808 DPRINTK("bad depth %u\n", info->var.bits_per_pixel); 809 break;
809 break; 810 default:
811 DPRINTK("bad depth %u\n", info->var.bits_per_pixel);
812 break;
810 } 813 }
814
811 return 0; 815 return 0;
812} 816}
813 817