• Antonino Daplas's avatar
    [PATCH] fbdev: Clean up of fbcon/fbdev cursor interface · 64c3967a
    Antonino Daplas authored
    The current cursor interface is confusing.  Some fields are taken from the
    cursor structure in struct fb_info (enable, mask, rop fields) and the rest are
    taken from the passed cursor structure.  These lead to a lot of confusion,
    making it hard for developers to write their own implementation.
    
    Also, the cursor code has several 'short-circuits', occassionally leading to
    undefined cursor behavior.
    
    These are the changes brought about by the patch:
    
    - Removed struct fb_cursor and related fields from struct fb_info, and
      instead, placed them in a struct not visible to fbdev.
    
    - The struct fb_cursor passed to fb_cursor() will _always_ contain valid
      data with various bitflags indicating which fields have changed
    
    - The struct fb_pixmap sprite in struct fb_info is used only by drivers with
      hardware cursor implementation.  Initializing and allocating memory for this
      structure is not needed.  Remove initialization and memory allocation.
    
    - The FBIO_CURSOR ioctl is broken (because fb_cursor() is broken).  For now,
      remove fb_cursor code and make the FBIO_CURSOR ioctl always return -ENODEV.
    
    - The flag FB_CUR_SETCUR is changed to FB_CUR_SETIMAGE, indicating that the
      cursor sprite has changed.  The image change is now checked by fbcon so
      drivers will not unnecessarily load the sprite image everytime.  This causes
      hardware cursors to flicker, especially in rivafb.
    
    - Remove fb_load_cursor_image().  This is unused, and should not be
      implemented generically.
    
    - Documented the usage of the cursor interface in skeletonfb.c
    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>
    64c3967a
fbcon.c 69.3 KB