diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2007-07-31 03:37:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-31 18:39:37 -0400 |
commit | 1692b37c99d5087cf2f814466a907a3dd35a1453 (patch) | |
tree | 6d1627b83b031c814698fb974916c5020eea2183 /drivers/video/fbmem.c | |
parent | c81f717cb9e0bd91dc4b98753cb2705ab0fe2801 (diff) |
fbdev: Fix logo if logo depth is less than framebuffer depth
The VGA16 logo (bpp = 4) and monochrome logo (bpp = 1) do not contain any
color information (no CLUT). If the fb depth is > logo depth, these logo's
will not properly display. Fix by using the console palette instead of
creating a new one.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r-- | drivers/video/fbmem.c | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 215ac579f901..074027204702 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -244,8 +244,17 @@ static void fb_set_logo(struct fb_info *info, | |||
244 | u8 xor = (info->fix.visual == FB_VISUAL_MONO01) ? 0xff : 0; | 244 | u8 xor = (info->fix.visual == FB_VISUAL_MONO01) ? 0xff : 0; |
245 | u8 fg = 1, d; | 245 | u8 fg = 1, d; |
246 | 246 | ||
247 | if (fb_get_color_depth(&info->var, &info->fix) == 3) | 247 | switch (fb_get_color_depth(&info->var, &info->fix)) { |
248 | case 1: | ||
249 | fg = 1; | ||
250 | break; | ||
251 | case 2: | ||
252 | fg = 3; | ||
253 | break; | ||
254 | default: | ||
248 | fg = 7; | 255 | fg = 7; |
256 | break; | ||
257 | } | ||
249 | 258 | ||
250 | if (info->fix.visual == FB_VISUAL_MONO01 || | 259 | if (info->fix.visual == FB_VISUAL_MONO01 || |
251 | info->fix.visual == FB_VISUAL_MONO10) | 260 | info->fix.visual == FB_VISUAL_MONO10) |
@@ -564,21 +573,6 @@ int fb_prepare_logo(struct fb_info *info, int rotate) | |||
564 | depth = 4; | 573 | depth = 4; |
565 | } | 574 | } |
566 | 575 | ||
567 | if (depth >= 8) { | ||
568 | switch (info->fix.visual) { | ||
569 | case FB_VISUAL_TRUECOLOR: | ||
570 | fb_logo.needs_truepalette = 1; | ||
571 | break; | ||
572 | case FB_VISUAL_DIRECTCOLOR: | ||
573 | fb_logo.needs_directpalette = 1; | ||
574 | fb_logo.needs_cmapreset = 1; | ||
575 | break; | ||
576 | case FB_VISUAL_PSEUDOCOLOR: | ||
577 | fb_logo.needs_cmapreset = 1; | ||
578 | break; | ||
579 | } | ||
580 | } | ||
581 | |||
582 | /* Return if no suitable logo was found */ | 576 | /* Return if no suitable logo was found */ |
583 | fb_logo.logo = fb_find_logo(depth); | 577 | fb_logo.logo = fb_find_logo(depth); |
584 | 578 | ||
@@ -604,6 +598,22 @@ int fb_prepare_logo(struct fb_info *info, int rotate) | |||
604 | else | 598 | else |
605 | fb_logo.depth = 1; | 599 | fb_logo.depth = 1; |
606 | 600 | ||
601 | |||
602 | if (fb_logo.depth > 4 && depth > 4) { | ||
603 | switch (info->fix.visual) { | ||
604 | case FB_VISUAL_TRUECOLOR: | ||
605 | fb_logo.needs_truepalette = 1; | ||
606 | break; | ||
607 | case FB_VISUAL_DIRECTCOLOR: | ||
608 | fb_logo.needs_directpalette = 1; | ||
609 | fb_logo.needs_cmapreset = 1; | ||
610 | break; | ||
611 | case FB_VISUAL_PSEUDOCOLOR: | ||
612 | fb_logo.needs_cmapreset = 1; | ||
613 | break; | ||
614 | } | ||
615 | } | ||
616 | |||
607 | return fb_prepare_extra_logos(info, fb_logo.logo->height, yres); | 617 | return fb_prepare_extra_logos(info, fb_logo.logo->height, yres); |
608 | } | 618 | } |
609 | 619 | ||