Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1692b37c99d5087cf2f814466a907a3dd35a1453
Commit:     1692b37c99d5087cf2f814466a907a3dd35a1453
Parent:     c81f717cb9e0bd91dc4b98753cb2705ab0fe2801
Author:     Antonino A. Daplas <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 31 00:37:36 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Jul 31 15:39:37 2007 -0700

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 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 215ac57..0740272 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -244,8 +244,17 @@ static void fb_set_logo(struct fb_info *info,
        u8 xor = (info->fix.visual == FB_VISUAL_MONO01) ? 0xff : 0;
        u8 fg = 1, d;
 
-       if (fb_get_color_depth(&info->var, &info->fix) == 3)
+       switch (fb_get_color_depth(&info->var, &info->fix)) {
+       case 1:
+               fg = 1;
+               break;
+       case 2:
+               fg = 3;
+               break;
+       default:
                fg = 7;
+               break;
+       }
 
        if (info->fix.visual == FB_VISUAL_MONO01 ||
            info->fix.visual == FB_VISUAL_MONO10)
@@ -564,21 +573,6 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
                depth = 4;
        }
 
-       if (depth >= 8) {
-               switch (info->fix.visual) {
-               case FB_VISUAL_TRUECOLOR:
-                       fb_logo.needs_truepalette = 1;
-                       break;
-               case FB_VISUAL_DIRECTCOLOR:
-                       fb_logo.needs_directpalette = 1;
-                       fb_logo.needs_cmapreset = 1;
-                       break;
-               case FB_VISUAL_PSEUDOCOLOR:
-                       fb_logo.needs_cmapreset = 1;
-                       break;
-               }
-       }
-
        /* Return if no suitable logo was found */
        fb_logo.logo = fb_find_logo(depth);
 
@@ -604,6 +598,22 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
        else
                fb_logo.depth = 1;
 
+
+       if (fb_logo.depth > 4 && depth > 4) {
+               switch (info->fix.visual) {
+               case FB_VISUAL_TRUECOLOR:
+                       fb_logo.needs_truepalette = 1;
+                       break;
+               case FB_VISUAL_DIRECTCOLOR:
+                       fb_logo.needs_directpalette = 1;
+                       fb_logo.needs_cmapreset = 1;
+                       break;
+               case FB_VISUAL_PSEUDOCOLOR:
+                       fb_logo.needs_cmapreset = 1;
+                       break;
+               }
+       }
+
        return fb_prepare_extra_logos(info, fb_logo.logo->height, yres);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to