• Egbert Eich's avatar
    [PATCH] vgacon fixes to help font restauration in X11 · 20f130b6
    Egbert Eich authored
    So far the X.Org/XFree86 Xservers use internal functions to perform
    saving/restoring of console fonts.  This doesn't work under all
    circumstances and has disadvantages:
    
    1. On some platforms (IA64) X needs to POST the BIOS before
       it even has a chance to access the hardware itself. This POSTing
       will usually undo any changes to the graphics hardware that the
       kernel may have done.
    2. More and more drivers fully rely on BIOS support. However
       the BIOS functions which could be used to save/restore
       register settings may be broken so the only way of mode
       save/restore is getting/setting the BIOS mode ID.
       This will restore the BIOSes default fonts, not the custom font
       that the user may have loaded.
    
    I would like to utilize the kernel's save/restore console fonts ioctls to
    save/restore the text mode console fonts from inside X.  
    
    The patch does two things:
    
    1. Eliminates the optimization that returns from vgacon_adjust_height()
       early (without reprogramming the HW) when the hight of the font hasn't
       changed.
    2. Resets the stored 'from' and 'to' lines for the text cursor in
       vgacon_adjust_height() to cause vgacon_set_cursor_size() reprogram
       the textcursor start and end line.
    
    These are necessary to sanitize the HW in case something other than the
    kernel has changed the register values without restoring them properly.
    
    I'm fully aware that in the long run we will need to look into a new driver
    model for graphics where no two instances fight over who gets register
    access.  However such a model won't be created nor will we get the majority
    of the drivers ported over night.  Therefore we need to find an interim
    solution for the most pressing problems.
    Signed-off-by: default avatarEgbert Eich <eich@freedesktop.org>
    Approved-by: default avatarAlan Cox <alan@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    20f130b6
vgacon.c 31.9 KB