]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/vrr: Use fixed timings for platforms that support VRR
authorAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Mon, 24 Mar 2025 13:32:41 +0000 (19:02 +0530)
committerAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Tue, 25 Mar 2025 15:47:25 +0000 (21:17 +0530)
For fixed refresh rate use fixed timings for all platforms that support
VRR. For this add checks to avoid computing and reading VRR for
platforms that do not support VRR.

v2: Avoid touching check for VRR_CTL_FLIP_LINE_EN. (Ville)
v3: Avoid redundant statements in vrr_{compute/get}_config. (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-10-ankit.k.nautiyal@intel.com
drivers/gpu/drm/i915/display/intel_vrr.c

index 96b6b730bea42bacc4601be6e6e4b425ecd0b740..f225fd7f34ffb800486c2d9537b007a235e9353c 100644 (file)
@@ -353,6 +353,9 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
        struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
        int vmin, vmax;
 
+       if (!HAS_VRR(display))
+               return;
+
        /*
         * FIXME all joined pipes share the same transcoder.
         * Need to account for that during VRR toggle/push/etc.
@@ -376,15 +379,12 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
                vmax = vmin;
        }
 
-       if (vmin >= vmax)
-               return;
-
        crtc_state->vrr.vmin = vmin;
        crtc_state->vrr.vmax = vmax;
 
        crtc_state->vrr.flipline = crtc_state->vrr.vmin;
 
-       if (crtc_state->uapi.vrr_enabled)
+       if (crtc_state->uapi.vrr_enabled && vmin < vmax)
                intel_vrr_compute_vrr_timings(crtc_state);
        else if (is_cmrr_frac_required(crtc_state) && is_edp)
                intel_vrr_compute_cmrr_timings(crtc_state);