diff mbox series

[25/35] drm/i915/vrr: Prepare for fixed refresh rate timings

Message ID 20250124150020.2271747-26-ankit.k.nautiyal@intel.com (mailing list archive)
State New
Headers show
Series Use VRR timing generator for fixed refresh rate modes | expand

Commit Message

Nautiyal, Ankit K Jan. 24, 2025, 3 p.m. UTC
Currently we always compute the timings as if vrr is enabled.
With this approach the state checker becomes complicated when we
introduce fixed refresh rate mode with vrr timing generator.

To avoid the complications, instead of always computing vrr timings, we
compute vrr timings based on uapi.vrr_enable knob.
So when the knob is disabled we always compute vmin=flipline=vmax.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_vrr.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c
index 5a1b0d61c483..7e9b60ce3fc4 100644
--- a/drivers/gpu/drm/i915/display/intel_vrr.c
+++ b/drivers/gpu/drm/i915/display/intel_vrr.c
@@ -223,6 +223,18 @@  cmrr_get_vtotal(struct intel_crtc_state *crtc_state, bool video_mode_required)
 	return vtotal;
 }
 
+static
+void intel_vrr_prepare_fixed_timings(struct intel_crtc_state *crtc_state, int vmin)
+{
+	/*
+	 * For fixed refresh rate mode Vmin, Vmax and Flipline all are set to
+	 * Vtotal value, which is already computed in vmin.
+	 */
+	crtc_state->vrr.vmin = vmin;
+	crtc_state->vrr.vmax = crtc_state->vrr.vmin;
+	crtc_state->vrr.flipline = crtc_state->vrr.vmax;
+}
+
 static
 void intel_vrr_prepare_vrr_timings(struct intel_crtc_state *crtc_state, int vmin, int vmax)
 {
@@ -350,7 +362,7 @@  intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
 	else if (is_cmrr_frac_required(crtc_state) && is_edp)
 		intel_vrr_compute_cmrr_timings(crtc_state);
 	else
-		intel_vrr_prepare_vrr_timings(crtc_state, vmin, vmax);
+		intel_vrr_prepare_fixed_timings(crtc_state, vmin);
 
 	if (HAS_AS_SDP(display)) {
 		crtc_state->vrr.vsync_start =