• Maarten Lankhorst's avatar
    drm/atomic: Allow for holes in connector state, v2. · 5fff80bb
    Maarten Lankhorst authored
    Because we record connector_mask using 1 << drm_connector_index now
    the connector_mask should stay the same even when other connectors
    are removed. This was not the case with MST, in that case when removing
    a connector all other connectors may change their index.
    
    This is fixed by waiting until the first get_connector_state to allocate
    connector_state, and force reallocation when state is too small.
    
    As a side effect connector arrays no longer have to be preallocated,
    and can be allocated on first use which means a less allocations in
    the page flip only path.
    
    Changes since v1:
    - Whitespace. (Ville)
    - Call ida_remove when destroying the connector. (Ville)
    - u32 alloc -> int. (Ville)
    
    Fixes: 14de6c44 ("drm/atomic: Remove drm_atomic_connectors_for_crtc.")
    Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Reviewed-by: default avatarLyude <cpaul@redhat.com>
    Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    5fff80bb
drm_crtc.h 92.5 KB