• Daniel Vetter's avatar
    fbcon: Maintain a private array of fb_info · efc3acbc
    Daniel Vetter authored
    Accessing the one in fbmem.c without taking the right locks is a bad
    idea. Instead maintain our own private copy, which is fully protected
    by console_lock() (like everything else in fbcon.c). That copy is
    serialized through fbcon_fb_registered/unregistered() calls.
    
    Also this means we do not need to hold a full fb_info reference, which
    is nice because doing so would mean a refcount loop between the
    console and the fb_info. But it's also not nice since it means
    console_lock() must be held absolutely everywhere. Well strictly
    speaking we could still try to do some refcounting games again by
    calling get_fb_info before we drop the console_lock. But things will
    get tricky.
    Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
    Cc: Daniel Vetter <daniel@ffwll.ch>
    Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Cc: Claudio Suarez <cssk@net-c.es>
    Cc: Du Cheng <ducheng2@gmail.com>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-18-daniel.vetter@ffwll.ch
    efc3acbc
fbcon.c 81.9 KB