]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/vrr: Refactor condition for computing vmax and LRR
authorAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Mon, 24 Mar 2025 13:32:37 +0000 (19:02 +0530)
committerAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Tue, 25 Mar 2025 15:47:24 +0000 (21:17 +0530)
LRR and Vmax can be computed only if VRR is supported and vrr.in_range
is set. Currently we proceed with vrr timings only for VRR supporting
panels and return otherwise. For using VRR TG with fix timings, need to
continue even for panels that do not support VRR.

To achieve this, refactor the condition for computing vmax and
update_lrr so that we can continue for fixed timings for panels that do
not support VRR.

v2: Set vmax = vmin for non VRR panels. (Ville)

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/20250324133248.4071909-6-ankit.k.nautiyal@intel.com
drivers/gpu/drm/i915/display/intel_vrr.c

index c682c487eb255ff462fdf6012ac2981a198d1cc4..e68c13ae21b37cc6113f8f83332a117e698e3332 100644 (file)
@@ -365,14 +365,16 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
 
        crtc_state->vrr.in_range =
                intel_vrr_is_in_range(connector, drm_mode_vrefresh(adjusted_mode));
-       if (!crtc_state->vrr.in_range)
-               return;
-
-       if (HAS_LRR(display))
-               crtc_state->update_lrr = true;
 
        vmin = intel_vrr_compute_vmin(crtc_state);
-       vmax = intel_vrr_compute_vmax(connector, adjusted_mode);
+
+       if (crtc_state->vrr.in_range) {
+               if (HAS_LRR(display))
+                       crtc_state->update_lrr = true;
+               vmax = intel_vrr_compute_vmax(connector, adjusted_mode);
+       } else {
+               vmax = vmin;
+       }
 
        if (vmin >= vmax)
                return;