aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_pm.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2022-02-14 12:55:29 +0200
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>2022-03-08 08:35:04 +0200
commit117f5bb31c8cdb1e8f0b443f2a0ac761bf54694c (patch)
treed981bf8add5917eab4898ef5d6a822e0ac4efca3 /drivers/gpu/drm/i915/intel_pm.c
parentdrm/i915: Avoid negative shift due to bigjoiner_pipes==0 (diff)
downloadlinux-dev-117f5bb31c8cdb1e8f0b443f2a0ac761bf54694c.tar.xz
linux-dev-117f5bb31c8cdb1e8f0b443f2a0ac761bf54694c.zip
drm/i915: Don't skip ddb allocation if data_rate==0
data_rate==0 no longer means a plane is disabled, it could also mean we want to use the minimum ddb allocation for it. Hence we can't bail out early during ddb allocation or else we'll simply forget to allocate any ddb for such planes. Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> Fixes: 6a4d8cc6bbbf ("drm/i915: Don't allocate extra ddb during async flip for DG2") Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220214105532.13049-2-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> (cherry picked from commit 6475e106821babc0dc478a9cb3fc3973739c43fb) Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_pm.c')
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 5af16ca4dabd..71f7fba2c9e2 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -5145,12 +5145,15 @@ skl_allocate_plane_ddb(struct skl_plane_ddb_iter *iter,
const struct skl_wm_level *wm,
u64 data_rate)
{
- u16 extra;
+ u16 extra = 0;
- extra = min_t(u16, iter->size,
- DIV64_U64_ROUND_UP(iter->size * data_rate, iter->data_rate));
- iter->size -= extra;
- iter->data_rate -= data_rate;
+ if (data_rate) {
+ extra = min_t(u16, iter->size,
+ DIV64_U64_ROUND_UP(iter->size * data_rate,
+ iter->data_rate));
+ iter->size -= extra;
+ iter->data_rate -= data_rate;
+ }
return wm->min_ddb_alloc + extra;
}
@@ -5193,9 +5196,6 @@ skl_crtc_allocate_plane_ddb(struct intel_atomic_state *state,
skl_ddb_entry_init(&crtc_state->wm.skl.plane_ddb_y[PLANE_CURSOR],
alloc->end - iter.total[PLANE_CURSOR], alloc->end);
- if (iter.data_rate == 0)
- return 0;
-
/*
* Find the highest watermark level for which we can satisfy the block
* requirement of active planes.
@@ -5234,6 +5234,10 @@ skl_crtc_allocate_plane_ddb(struct intel_atomic_state *state,
return -EINVAL;
}
+ /* avoid the WARN later when we don't allocate any extra DDB */
+ if (iter.data_rate == 0)
+ iter.size = 0;
+
/*
* Grant each plane the blocks it requires at the highest achievable
* watermark level, plus an extra share of the leftover blocks
@@ -5246,20 +5250,10 @@ skl_crtc_allocate_plane_ddb(struct intel_atomic_state *state,
if (plane_id == PLANE_CURSOR)
continue;
- /*
- * We've accounted for all active planes; remaining planes are
- * all disabled.
- */
- if (iter.data_rate == 0)
- break;
-
iter.total[plane_id] =
skl_allocate_plane_ddb(&iter, &wm->wm[level],
crtc_state->plane_data_rate[plane_id]);
- if (iter.data_rate == 0)
- break;
-
iter.uv_total[plane_id] =
skl_allocate_plane_ddb(&iter, &wm->uv_wm[level],
crtc_state->uv_plane_data_rate[plane_id]);