Skip to content

Commit 18ffd6d

Browse files
committed
drm/i915: Calculate min_ddb_alloc for trans_wm
Let's make all the "do we have enough DDB for this WM level?" checks use min_ddb_alloc. To achieve that we need to populate this for the transition watermarks as well. Cc: Stanislav Lisovskiy <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Stanislav Lisovskiy <[email protected]>
1 parent f0dfaa9 commit 18ffd6d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4986,13 +4986,13 @@ skl_allocate_plane_ddb(struct intel_atomic_state *state,
49864986
struct skl_plane_wm *wm =
49874987
&crtc_state->wm.skl.optimal.planes[plane_id];
49884988

4989-
if (wm->trans_wm.plane_res_b >= total[plane_id])
4989+
if (wm->trans_wm.min_ddb_alloc > total[plane_id])
49904990
memset(&wm->trans_wm, 0, sizeof(wm->trans_wm));
49914991

49924992
if (wm->sagv.wm0.min_ddb_alloc > total[plane_id])
49934993
memset(&wm->sagv.wm0, 0, sizeof(wm->sagv.wm0));
49944994

4995-
if (wm->sagv.trans_wm.plane_res_b >= total[plane_id])
4995+
if (wm->sagv.trans_wm.min_ddb_alloc > total[plane_id])
49964996
memset(&wm->sagv.trans_wm, 0, sizeof(wm->sagv.trans_wm));
49974997
}
49984998

@@ -5404,13 +5404,15 @@ static void skl_compute_transition_wm(struct drm_i915_private *dev_priv,
54045404
} else {
54055405
res_blocks = wm0_sel_res_b + trans_offset_b;
54065406
}
5407+
res_blocks++;
54075408

54085409
/*
54095410
* Just assume we can enable the transition watermark. After
54105411
* computing the DDB we'll come back and disable it if that
54115412
* assumption turns out to be false.
54125413
*/
5413-
trans_wm->plane_res_b = res_blocks + 1;
5414+
trans_wm->plane_res_b = res_blocks;
5415+
trans_wm->min_ddb_alloc = max_t(u16, wm0->min_ddb_alloc, res_blocks + 1);
54145416
trans_wm->plane_en = true;
54155417
}
54165418

0 commit comments

Comments
 (0)