mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
drm/i915: Treat SAGV block time 0 as SAGV disabled
commit1937f3feb0
upstream. For modern platforms the spec explicitly states that a SAGV block time of zero means that SAGV is not supported. Let's extend that to all platforms. Supposedly there should be no systems where this isn't true, and it'll allow us to: - use the same code regardless of older vs. newer platform - wm latencies already treat 0 as disabled, so this fits well with other related code - make it a bit more clear when SAGV is used vs. not - avoid overflows from adding U32_MAX with a u16 wm0 latency value which could cause us to miscalculate the SAGV watermarks on tgl+ Cc: stable@vger.kernel.org Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220309164948.10671-2-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> (cherry picked from commitd8f5855b31
) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e912d69740
commit
102cba6d5a
1 changed files with 6 additions and 4 deletions
|
@ -3713,8 +3713,7 @@ skl_setup_sagv_block_time(struct drm_i915_private *dev_priv)
|
|||
MISSING_CASE(DISPLAY_VER(dev_priv));
|
||||
}
|
||||
|
||||
/* Default to an unusable block time */
|
||||
dev_priv->sagv_block_time_us = -1;
|
||||
dev_priv->sagv_block_time_us = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -5635,7 +5634,7 @@ static void skl_compute_plane_wm(const struct intel_crtc_state *crtc_state,
|
|||
result->min_ddb_alloc = max(min_ddb_alloc, blocks) + 1;
|
||||
result->enable = true;
|
||||
|
||||
if (DISPLAY_VER(dev_priv) < 12)
|
||||
if (DISPLAY_VER(dev_priv) < 12 && dev_priv->sagv_block_time_us)
|
||||
result->can_sagv = latency >= dev_priv->sagv_block_time_us;
|
||||
}
|
||||
|
||||
|
@ -5666,7 +5665,10 @@ static void tgl_compute_sagv_wm(const struct intel_crtc_state *crtc_state,
|
|||
struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
|
||||
struct skl_wm_level *sagv_wm = &plane_wm->sagv.wm0;
|
||||
struct skl_wm_level *levels = plane_wm->wm;
|
||||
unsigned int latency = dev_priv->wm.skl_latency[0] + dev_priv->sagv_block_time_us;
|
||||
unsigned int latency = 0;
|
||||
|
||||
if (dev_priv->sagv_block_time_us)
|
||||
latency = dev_priv->sagv_block_time_us + dev_priv->wm.skl_latency[0];
|
||||
|
||||
skl_compute_plane_wm(crtc_state, 0, latency,
|
||||
wm_params, &levels[0],
|
||||
|
|
Loading…
Reference in a new issue