Commit 4da409ba authored by Suraj Kandpal's avatar Suraj Kandpal

drm/i915/dpkgc: Add VRR condition for DPKGC Enablement

DPKGC can now be enabled with VRR enabled if Vmin = Vmax = Flipline
is met.

Bspec: 68986
Signed-off-by: default avatarSuraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: default avatarMitul Golani <mitulkumar.ajitkumar.golani@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240711044905.3306882-1-suraj.kandpal@intel.com
parent 5c7b3934
...@@ -2830,17 +2830,17 @@ static int skl_wm_add_affected_planes(struct intel_atomic_state *state, ...@@ -2830,17 +2830,17 @@ static int skl_wm_add_affected_planes(struct intel_atomic_state *state,
} }
/* /*
* If Fixed Refresh Rate: * If Fixed Refresh Rate or For VRR case Vmin = Vmax = Flipline:
* Program DEEP PKG_C_LATENCY Pkg C with highest valid latency from * Program DEEP PKG_C_LATENCY Pkg C with highest valid latency from
* watermark level1 and up and above. If watermark level 1 is * watermark level1 and up and above. If watermark level 1 is
* invalid program it with all 1's. * invalid program it with all 1's.
* Program PKG_C_LATENCY Added Wake Time = DSB execution time * Program PKG_C_LATENCY Added Wake Time = DSB execution time
* If Variable Refresh Rate: * If Variable Refresh Rate where Vmin != Vmax != Flipline:
* Program DEEP PKG_C_LATENCY Pkg C with all 1's. * Program DEEP PKG_C_LATENCY Pkg C with all 1's.
* Program PKG_C_LATENCY Added Wake Time = 0 * Program PKG_C_LATENCY Added Wake Time = 0
*/ */
static void static void
skl_program_dpkgc_latency(struct drm_i915_private *i915, bool vrr_enabled) skl_program_dpkgc_latency(struct drm_i915_private *i915, bool enable_dpkgc)
{ {
u32 max_latency = 0; u32 max_latency = 0;
u32 clear = 0, val = 0; u32 clear = 0, val = 0;
...@@ -2849,15 +2849,15 @@ skl_program_dpkgc_latency(struct drm_i915_private *i915, bool vrr_enabled) ...@@ -2849,15 +2849,15 @@ skl_program_dpkgc_latency(struct drm_i915_private *i915, bool vrr_enabled)
if (DISPLAY_VER(i915) < 20) if (DISPLAY_VER(i915) < 20)
return; return;
if (vrr_enabled) { if (enable_dpkgc) {
max_latency = LNL_PKG_C_LATENCY_MASK;
added_wake_time = 0;
} else {
max_latency = skl_watermark_max_latency(i915, 1); max_latency = skl_watermark_max_latency(i915, 1);
if (max_latency == 0) if (max_latency == 0)
max_latency = LNL_PKG_C_LATENCY_MASK; max_latency = LNL_PKG_C_LATENCY_MASK;
added_wake_time = DSB_EXE_TIME + added_wake_time = DSB_EXE_TIME +
i915->display.sagv.block_time_us; i915->display.sagv.block_time_us;
} else {
max_latency = LNL_PKG_C_LATENCY_MASK;
added_wake_time = 0;
} }
clear |= LNL_ADDED_WAKE_TIME_MASK | LNL_PKG_C_LATENCY_MASK; clear |= LNL_ADDED_WAKE_TIME_MASK | LNL_PKG_C_LATENCY_MASK;
...@@ -2873,7 +2873,7 @@ skl_compute_wm(struct intel_atomic_state *state) ...@@ -2873,7 +2873,7 @@ skl_compute_wm(struct intel_atomic_state *state)
struct intel_crtc *crtc; struct intel_crtc *crtc;
struct intel_crtc_state __maybe_unused *new_crtc_state; struct intel_crtc_state __maybe_unused *new_crtc_state;
int ret, i; int ret, i;
bool vrr_enabled = false; bool enable_dpkgc = false;
for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) { for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
ret = skl_build_pipe_wm(state, crtc); ret = skl_build_pipe_wm(state, crtc);
...@@ -2899,11 +2899,13 @@ skl_compute_wm(struct intel_atomic_state *state) ...@@ -2899,11 +2899,13 @@ skl_compute_wm(struct intel_atomic_state *state)
if (ret) if (ret)
return ret; return ret;
if (new_crtc_state->vrr.enable) if ((new_crtc_state->vrr.vmin == new_crtc_state->vrr.vmax &&
vrr_enabled = true; new_crtc_state->vrr.vmin == new_crtc_state->vrr.flipline) ||
!new_crtc_state->vrr.enable)
enable_dpkgc = true;
} }
skl_program_dpkgc_latency(to_i915(state->base.dev), vrr_enabled); skl_program_dpkgc_latency(to_i915(state->base.dev), enable_dpkgc);
skl_print_wm_changes(state); skl_print_wm_changes(state);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment