diff options
Diffstat (limited to 'drivers/video/gbefb.c')
-rw-r--r-- | drivers/video/gbefb.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c index bf0e60b5a3b6..b9b572b293d4 100644 --- a/drivers/video/gbefb.c +++ b/drivers/video/gbefb.c | |||
@@ -86,7 +86,7 @@ static int gbe_revision; | |||
86 | 86 | ||
87 | static int ypan, ywrap; | 87 | static int ypan, ywrap; |
88 | 88 | ||
89 | static uint32_t pseudo_palette[256]; | 89 | static uint32_t pseudo_palette[16]; |
90 | 90 | ||
91 | static char *mode_option __initdata = NULL; | 91 | static char *mode_option __initdata = NULL; |
92 | 92 | ||
@@ -854,8 +854,7 @@ static int gbefb_setcolreg(unsigned regno, unsigned red, unsigned green, | |||
854 | green >>= 8; | 854 | green >>= 8; |
855 | blue >>= 8; | 855 | blue >>= 8; |
856 | 856 | ||
857 | switch (info->var.bits_per_pixel) { | 857 | if (info->var.bits_per_pixel <= 8) { |
858 | case 8: | ||
859 | /* wait for the color map FIFO to have a free entry */ | 858 | /* wait for the color map FIFO to have a free entry */ |
860 | for (i = 0; i < 1000 && gbe->cm_fifo >= 63; i++) | 859 | for (i = 0; i < 1000 && gbe->cm_fifo >= 63; i++) |
861 | udelay(10); | 860 | udelay(10); |
@@ -864,23 +863,25 @@ static int gbefb_setcolreg(unsigned regno, unsigned red, unsigned green, | |||
864 | return 1; | 863 | return 1; |
865 | } | 864 | } |
866 | gbe->cmap[regno] = (red << 24) | (green << 16) | (blue << 8); | 865 | gbe->cmap[regno] = (red << 24) | (green << 16) | (blue << 8); |
867 | break; | 866 | } else if (regno < 16) { |
868 | case 15: | 867 | switch (info->var.bits_per_pixel) { |
869 | case 16: | 868 | case 15: |
870 | red >>= 3; | 869 | case 16: |
871 | green >>= 3; | 870 | red >>= 3; |
872 | blue >>= 3; | 871 | green >>= 3; |
873 | pseudo_palette[regno] = | 872 | blue >>= 3; |
874 | (red << info->var.red.offset) | | 873 | pseudo_palette[regno] = |
875 | (green << info->var.green.offset) | | 874 | (red << info->var.red.offset) | |
876 | (blue << info->var.blue.offset); | 875 | (green << info->var.green.offset) | |
877 | break; | 876 | (blue << info->var.blue.offset); |
878 | case 32: | 877 | break; |
879 | pseudo_palette[regno] = | 878 | case 32: |
880 | (red << info->var.red.offset) | | 879 | pseudo_palette[regno] = |
881 | (green << info->var.green.offset) | | 880 | (red << info->var.red.offset) | |
882 | (blue << info->var.blue.offset); | 881 | (green << info->var.green.offset) | |
883 | break; | 882 | (blue << info->var.blue.offset); |
883 | break; | ||
884 | } | ||
884 | } | 885 | } |
885 | 886 | ||
886 | return 0; | 887 | return 0; |