• Ville Syrjälä's avatar
    drm/fb-helper: Keep references for the current set of used connectors · a2889606
    Ville Syrjälä authored
    The fbdev helper code keeps around two lists of connectors. One is the
    list of all connectors it could use, and that list already holds
    references for all the connectors. However the other list, or rather
    lists, is the one actively being used. That list is tracked per-crtc
    and currently doesn't hold any extra references. Let's grab those
    extra references to avoid oopsing when the connector vanishes. The
    list of all possible connectors should get updated when the hpd happens,
    but the list of actively used connectors would not get updated until
    the next time the fb-helper picks through the set of possible connectors.
    And so we need to hang on to the connectors until that time.
    
    Since we need to clean up in drm_fb_helper_crtc_free() as well,
    let's pull the code to a common place. And while at it let's
    pull in up the modeset->mode cleanup in there as well. The case
    of modeset->fb is a bit less clear. I'm thinking we should probably
    hold a reference to it, but for now I just slapped on a FIXME.
    
    v2: Cleanup things drm_fb_helper_crtc_free() too (Chris)
    v3: Don't leak modeset->connectors (Chris)
    
    Cc: Chris Wilson <chris@chris-wilson.co.uk>
    Cc: stable@vger.kernel.org
    Cc: Carlos Santa <carlos.santa@intel.com>
    Cc: Kirill A. Shutemov <kirill@shutemov.name>
    Tested-by: Carlos Santa <carlos.santa@intel.com> (v1)
    Tested-by: Kirill A. Shutemov <kirill@shutemov.name> (v1)
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97666Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    Link: http://patchwork.freedesktop.org/patch/msgid/1477492878-4990-1-git-send-email-ville.syrjala@linux.intel.com
    a2889606
drm_fb_helper.c 64.5 KB