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

Ankit Nautiyal ankit.k.nautiyal at intel.com
Tue Jun 18 06:32:38 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 240bfb5633ad..215a8378a67d 100644
--- a/drivers/gpu/drm/i915/display/intel_vrr.c
+++ b/drivers/gpu/drm/i915/display/intel_vrr.c
@@ -181,17 +181,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;
@@ -200,6 +195,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