Skip to content

Commit 9aa5975

Browse files
committed
drm/i915/wm: Modify latency programmed into PKG_C_LATENCY
Increase the latency programmed into PKG_C_LATENCY latency to be a multiple of line time which is written into WM_LINETIME. --v2 -Fix commit subject line [Sai Teja] -Use individual DISPLAY_VER checks instead of range [Sai Teja] -Initialize max_linetime [Sai Teja] --v3 -take into account the scenario when adjusted_latency is 0 [Vinod] --v4 -rename adjusted_latency to latency [Mitul] -fix the condition in which dpkgc is disabled [Vinod] --v5 -Add check to see if max_linetime is 0 [Vinod] --v6 -Avoid nested if statements [Mitul] WA: 22020299601 Signed-off-by: Suraj Kandpal <[email protected]> Reviewed-by: Mitul Golani <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 555a09d commit 9aa5975

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

drivers/gpu/drm/i915/display/skl_watermark.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2861,7 +2861,8 @@ intel_program_dpkgc_latency(struct intel_atomic_state *state)
28612861
struct drm_i915_private *i915 = to_i915(display->drm);
28622862
struct intel_crtc *crtc;
28632863
struct intel_crtc_state *new_crtc_state;
2864-
u32 max_latency = LNL_PKG_C_LATENCY_MASK;
2864+
u32 latency = LNL_PKG_C_LATENCY_MASK;
2865+
u32 max_linetime = 0;
28652866
u32 clear, val;
28662867
u32 added_wake_time = 0;
28672868
bool fixed_refresh_rate = false;
@@ -2875,18 +2876,26 @@ intel_program_dpkgc_latency(struct intel_atomic_state *state)
28752876
(new_crtc_state->vrr.vmin == new_crtc_state->vrr.vmax &&
28762877
new_crtc_state->vrr.vmin == new_crtc_state->vrr.flipline))
28772878
fixed_refresh_rate = true;
2879+
2880+
max_linetime = max(new_crtc_state->linetime, max_linetime);
28782881
}
28792882

28802883
if (fixed_refresh_rate) {
2881-
max_latency = skl_watermark_max_latency(i915, 1);
2882-
if (max_latency == 0)
2883-
max_latency = LNL_PKG_C_LATENCY_MASK;
2884+
latency = skl_watermark_max_latency(i915, 1);
2885+
/* Wa_22020299601 */
2886+
if ((latency && max_linetime) &&
2887+
(DISPLAY_VER(display) == 20 || DISPLAY_VER(display) == 30)) {
2888+
latency = max_linetime * DIV_ROUND_UP(latency, max_linetime);
2889+
} else if (!latency) {
2890+
latency = LNL_PKG_C_LATENCY_MASK;
2891+
}
2892+
28842893
added_wake_time = DSB_EXE_TIME +
28852894
display->sagv.block_time_us;
28862895
}
28872896

28882897
clear = LNL_ADDED_WAKE_TIME_MASK | LNL_PKG_C_LATENCY_MASK;
2889-
val = REG_FIELD_PREP(LNL_PKG_C_LATENCY_MASK, max_latency) |
2898+
val = REG_FIELD_PREP(LNL_PKG_C_LATENCY_MASK, latency) |
28902899
REG_FIELD_PREP(LNL_ADDED_WAKE_TIME_MASK, added_wake_time);
28912900

28922901
intel_de_rmw(display, LNL_PKG_C_LATENCY, clear, val);

0 commit comments

Comments
 (0)