[PATCH 11/12] drm/i915/vrr: Add support for fixed_rr from MTL

Ankit Nautiyal ankit.k.nautiyal at intel.com
Wed Jun 19 04:06:42 UTC 2024


Use VRR TG from MTL onwards for fixed refresh rate.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal at intel.com>
---
 drivers/gpu/drm/i915/display/intel_vrr.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c
index f62c007311ce..913752424adc 100644
--- a/drivers/gpu/drm/i915/display/intel_vrr.c
+++ b/drivers/gpu/drm/i915/display/intel_vrr.c
@@ -174,17 +174,12 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
 	if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE)
 		return;
 
-	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(i915))
 		crtc_state->update_lrr = true;
 
-	if (!crtc_state->uapi.vrr_enabled && DISPLAY_VER(i915) >= 20) {
+	if (!crtc_state->uapi.vrr_enabled && DISPLAY_VER(i915) >= 14) {
 		/*
-		 * for LNL+ if panel supports VRR and user has not set VRR,
+		 * for MTL+ if panel supports VRR and user has not set VRR,
 		 * always go for fixed average Vtotal mode.
 		 */
 		crtc_state->vrr.vmin = adjusted_mode->crtc_vtotal;
@@ -193,6 +188,13 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
 		crtc_state->vrr.fixed_rr = true;
 	} else {
 
+		crtc_state->vrr.in_range =
+			intel_vrr_is_in_range(connector, drm_mode_vrefresh(adjusted_mode));
+
+		if (!crtc_state->vrr.in_range)
+			return;
+
+
 		vmin = DIV_ROUND_UP(adjusted_mode->crtc_clock * 1000,
 				    adjusted_mode->crtc_htotal * info->monitor_range.max_vfreq);
 		vmax = adjusted_mode->crtc_clock * 1000 /
-- 
2.40.1



More information about the Intel-gfx-trybot mailing list