drm/i915/vrr: Use set_context_latency instead of intel_vrr_real_vblank_delay()

The helper intel_vrr_real_vblank_delay() was added to account for the
SCL lines for TGL where we do not have the TRANS_SET_CONTEXT_LATENCY.

Now, since we already are tracking the SCL with new member
`set_context_latency` use it directly instead of the helper.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250924141542.3122126-4-ankit.k.nautiyal@intel.com
This commit is contained in:
Ankit Nautiyal 2025-09-24 19:45:35 +05:30
parent 419daf7d83
commit 6441d9038f

View File

@ -79,12 +79,6 @@ intel_vrr_check_modeset(struct intel_atomic_state *state)
}
}
static int intel_vrr_real_vblank_delay(const struct intel_crtc_state *crtc_state)
{
return crtc_state->hw.adjusted_mode.crtc_vblank_start -
crtc_state->hw.adjusted_mode.crtc_vdisplay;
}
static int intel_vrr_extra_vblank_delay(struct intel_display *display)
{
/*
@ -102,7 +96,7 @@ int intel_vrr_vblank_delay(const struct intel_crtc_state *crtc_state)
{
struct intel_display *display = to_intel_display(crtc_state);
return intel_vrr_real_vblank_delay(crtc_state) +
return crtc_state->set_context_latency +
intel_vrr_extra_vblank_delay(display);
}
@ -263,7 +257,7 @@ static int intel_vrr_hw_value(const struct intel_crtc_state *crtc_state,
if (DISPLAY_VER(display) >= 13)
return value;
else
return value - intel_vrr_real_vblank_delay(crtc_state);
return value - crtc_state->set_context_latency;
}
/*
@ -768,9 +762,9 @@ void intel_vrr_get_config(struct intel_crtc_state *crtc_state)
if (DISPLAY_VER(display) < 13) {
/* undo what intel_vrr_hw_value() does when writing the values */
crtc_state->vrr.flipline += intel_vrr_real_vblank_delay(crtc_state);
crtc_state->vrr.vmax += intel_vrr_real_vblank_delay(crtc_state);
crtc_state->vrr.vmin += intel_vrr_real_vblank_delay(crtc_state);
crtc_state->vrr.flipline += crtc_state->set_context_latency;
crtc_state->vrr.vmax += crtc_state->set_context_latency;
crtc_state->vrr.vmin += crtc_state->set_context_latency;
crtc_state->vrr.vmin += intel_vrr_vmin_flipline_offset(display);
}