]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i195/vrr: Move crtc_state->vrr.{vmin,vmax} update into intel_vrr_compute_vrr_timi...
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 20 Oct 2025 18:50:22 +0000 (21:50 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 24 Oct 2025 21:10:58 +0000 (00:10 +0300)
The way intel_vrr_compute_*_timings() works is rather confusing.
First intel_vrr_compute_config() assigns the computed vmin/vmax
into crtc_state->vrr.{vmin,vmax}, and then either
intel_vrr_compute_vrr_timings() leaves them untouched or
intel_vrr_compute_{cmrr,fixed_rr}_timings() overwrite them with
something else.

Clean this up by moving all crtc_state->vrr.{vmin,vmax} assignments
into intel_vrr_compute_*_timings().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20251020185038.4272-7-ville.syrjala@linux.intel.com
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
drivers/gpu/drm/i915/display/intel_vrr.c

index 01cb9cfe08e1903ff5bd98c8922ecca49035f06a..9179ad53a2e766460816f6d0c7968297085b824b 100644 (file)
@@ -235,8 +235,13 @@ void intel_vrr_compute_cmrr_timings(struct intel_crtc_state *crtc_state)
 }
 
 static
-void intel_vrr_compute_vrr_timings(struct intel_crtc_state *crtc_state)
+void intel_vrr_compute_vrr_timings(struct intel_crtc_state *crtc_state,
+                                  int vmin, int vmax)
 {
+       crtc_state->vrr.vmax = vmax;
+       crtc_state->vrr.vmin = vmin;
+       crtc_state->vrr.flipline = crtc_state->vrr.vmin;
+
        crtc_state->vrr.enable = true;
        crtc_state->mode_flags |= I915_MODE_FLAG_VRR;
 }
@@ -381,13 +386,8 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
                vmax = vmin;
        }
 
-       crtc_state->vrr.vmin = vmin;
-       crtc_state->vrr.vmax = vmax;
-
-       crtc_state->vrr.flipline = crtc_state->vrr.vmin;
-
        if (crtc_state->uapi.vrr_enabled && vmin < vmax)
-               intel_vrr_compute_vrr_timings(crtc_state);
+               intel_vrr_compute_vrr_timings(crtc_state, vmin, vmax);
        else if (is_cmrr_frac_required(crtc_state) && is_edp)
                intel_vrr_compute_cmrr_timings(crtc_state);
        else