• Ville Syrjälä's avatar
    drm/i915: Encapsulate dbuf state handling harder · ef79d62b
    Ville Syrjälä authored
    In order to make the dbuf state computation less fragile
    let's make it stand on its own feet by not requiring someone
    to peek into a crystall ball ahead of time to figure out
    which pipes need to be added to the state under which potential
    future conditions. Instead we compute each piece of the state
    as we go along, and if any fallout occurs that affects more than
    the current set of pipes we add the affected pipes to the state
    naturally.
    
    That requires that we track a few extra thigns in the global
    dbuf state: dbuf slices for each pipe, and the weight each
    pipe has when distributing the same set of slice(s) between
    multiple pipes. Easy enough.
    
    We do need to follow a somewhat careful sequence of computations
    though as there are several steps involved in cooking up the dbuf
    state. Thoguh we could avoid some of that by computing more things
    on demand instead of relying on earlier step of the algorithm to
    have filled it out. I think the end result is still reasonable
    as the entire sequence is pretty much consolidated into a single
    function instead of being spread around all over.
    
    The rough sequence is this:
    1. calculate active_pipes
    2. calculate dbuf slices for every pipe
    3. calculate total enabled slices
    4. calculate new dbuf weights for any crtc in the state
    5. calculate new ddb entry for every pipe based on the sets of
       slices and weights, and add any affected crtc to the state
    6. calculate new plane ddb entries for all crtcs in the state,
       and add any affected plane to the state so that we'll perform
       the requisite hw reprogramming
    
    And as a nice bonus we get to throw dev_priv->wm.distrust_bios_wm
    out the window.
    
    v2: Keep crtc_state->wm.skl.ddb
    Reviewed-by: default avatarStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
    Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20210122205633.18492-8-ville.syrjala@linux.intel.com
    ef79d62b
intel_pm.h 3.59 KB