• Ville Syrjälä's avatar
    drm/i915: Compute use_sagv_wm differently · 1e41fa94
    Ville Syrjälä authored
    drm_atomic_check_only() gets upset if we try to add extra crtcs
    to any commit that isn't flagged with DRM_MODE_ATOMIC_ALLOW_MODESET.
    This conflicts with how SAGV watermarks work on pre-ADL as we
    need to manually switch over the SAGV watermarks before we can
    safely enable SAGV.
    
    So in order to make SAGV usage possible we need to compute each
    pipe's use of SAGV watermarks as if there aren't any other
    active pipes. Ie. if the current pipe isn't the one blocking
    SAGV then we make it use the SAGV watermarks, even if some
    other pipe prevents SAGV from actually being used. Otherwise
    we could end up with a pipes using the normal watermarks (but
    not blocking SAGV), and some other pipe in parallel enabling
    SAGV, which would likely cause underruns.
    
    The alternative approach of preventing SAGV usage until all
    pipes simultanously end up using SAGV watermarks would only
    really work if userspace always adds all pipes to every
    commits, which isn't the case typically.
    
    The downside of this is that we will end up using the less
    optimal SAGV watermarks even if some other pipe prevents
    SAGV from actually being enabled. In which case the system
    won't achieve the minimum possible power consumption.
    Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20231219130756.25986-2-ville.syrjala@linux.intel.comReviewed-by: default avatarStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
    1e41fa94
skl_watermark.c 104 KB