• Antonino Daplas's avatar
    [PATCH] fbcon: ifferentiate bits_per_pixel from color depth · 37709b41
    Antonino Daplas authored
    1. If you remember this thread (HP300 support checked in), one concern
       was how to support framebuffers with bpp == 8 but color depth < 8
       (chunky layout).  I suggested to use the fields in var->{red|green|blue}
       to differentiate between bits_per_pixel and depth.  Included is a patch
       that does that.
    
       (The above assumes background/foreground of 0/1.  If hardware needs a
       different value, such as 0 - black, 0xff - white, just indicate
       TRUECOLOR or DIRECTCOLOR and set info->pseudopalette correctly in
       xxxfb_setcolreg().)
    
       The patch will break the following drivers when in monochrome since
       they do not set the proper color bitfields.  I've included a fix in
       patch #2.
    
       68328fb
       bw2fb
       cirrusfb
       dnfb
       macfb
       stifb
       tx3912fb
    
    2. Besides the change above, support for the inverse and underline
       attribute is added in monochrome mode.  One should get text which are
       underlined/reversed if the corresponding attribute is set.
    
    3. Because vt.c uses a 16-color palette, use fbcon_default_cmap if
       framebuffer can do less than 16 colors.  In 4 colors, display will be
       grayscaled.  In 8 colors, display should have the same colors as a
       16-color console but will lack brightness/ intensity.
    
    4. Fix monochrome logo drawing.
    
    5. Reduce code of fbcon_putc so it just calls fbcon_putcs.
    Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    37709b41
fbmem.c 40.5 KB