• Antonino Daplas's avatar
    [PATCH] fbdev: Introduce FB_BLANK_* constants · 8d5b3b97
    Antonino Daplas authored
    The VESA_* constants in fb.h used for power management of the display is
    confusing to use.  The constants seems to be meant for userspace, because
    within the kernel (vt and fbdev), the constants have to be incremented by
    1.  Implementation of fb_blank() varies from driver to driver:
    
    - if-else on blank/!blank
    
    - switch case on hardcoded numbers
    
    - switch case on the constants + 1
    
    - switch -1, case  on constants as is
    
    - switch case on the constants as is (broken)
    
    To make usage clearer, new constants are defined in fb.h:
    
    FB_BLANK_UNBLANK  = VESA_UNBLANKING = 0;
    FB_BLANK_NORMAL = VESA_UNBLANKING + 1 = 1;
    FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SUSPEND + 1 = 2;
    FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SUSPEND + 1 = 3;
    FB_BLANK_POWERDOWN = VESA_POWERDOWN + 1 = 4;
    
    Other changes:
    
    - generic blanking code in fbcon.c (for drivers without an fb_blank hook)
      which either sets the palette to all black, or clear the screen with
      black.
    
    - make fb_display an unexportable symbol
    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>
    8d5b3b97
fbmem.c 30.5 KB