• Matt Roper's avatar
    drm/i915: Calculate ILK-style watermarks during atomic check (v3) · a28170f3
    Matt Roper authored
    Calculate pipe watermarks during atomic calculation phase, based on the
    contents of the atomic transaction's state structure.  We still program
    the watermarks at the same time we did before, but the computation now
    happens much earlier.
    
    While this patch isn't too exciting by itself, it paves the way for
    future patches.  The eventual goal (which will be realized in future
    patches in this series) is to calculate multiple sets up watermark
    values up front, and then program them at different times (pre- vs
    post-vblank) on the platforms that need a two-step watermark update.
    
    While we're at it, s/intel_compute_pipe_wm/ilk_compute_pipe_wm/ since
    this function only applies to ILK-style watermarks and we have a
    completely different function for SKL-style watermarks.
    
    Note that the original code had a memcmp() in ilk_update_wm() to avoid
    calling ilk_program_watermarks() if the watermarks hadn't changed.  This
    memcmp vanishes here, which means we may do some unnecessary result
    generation and merging in cases where watermarks didn't change, but the
    lower-level function ilk_write_wm_values already makes sure that we
    don't actually try to program the watermark registers again.
    
    v2: Squash a few commits from the original series together; no longer
        leave pre-calculated wm's in a separate temporary structure since
        it's easier to follow the logic if we just cut over to using the
        pre-calculated values directly.
    
    v3:
     - Pass intel_crtc instead of drm_crtc to .compute_pipe_wm() entrypoint
       and use intel_atomic_get_crtc_state() to avoid need for extra
       casting.  (Ander)
     - Drop unused intel_check_crtc() function prototype.  (Ander)
    Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
    Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    a28170f3
i915_drv.h 105 KB