From b28c1929d75821b29c49c284ec3dc4d0e23c193f Mon Sep 17 00:00:00 2001 From: Ankit Nautiyal Date: Tue, 9 Jun 2026 08:23:25 +0530 Subject: [PATCH] drm/i915/panel: Preserve Vtotal-Vsync distance while adjusting vtotal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As we increase the vtotal to accommodate lower resfresh rate for fixed modes, adjust the vtotal-vsync distance also. v2: Rename vsync_*_diff to vsync_*_offset for clarity. (Ville) Signed-off-by: Ankit Nautiyal Reviewed-by: Ville Syrjälä Link: https://patch.msgid.link/20260609025325.1128543-3-ankit.k.nautiyal@intel.com --- drivers/gpu/drm/i915/display/intel_panel.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index 20c548eea6da..81fb349ece5f 100644 --- a/drivers/gpu/drm/i915/display/intel_panel.c +++ b/drivers/gpu/drm/i915/display/intel_panel.c @@ -237,11 +237,18 @@ int intel_panel_compute_config(struct intel_connector *connector, drm_mode_copy(adjusted_mode, fixed_mode); - if (is_vrr && fixed_mode_vrefresh != vrefresh) + if (is_vrr && fixed_mode_vrefresh != vrefresh) { + int vsync_start_offset = adjusted_mode->vtotal - adjusted_mode->vsync_start; + int vsync_end_offset = adjusted_mode->vtotal - adjusted_mode->vsync_end; + adjusted_mode->vtotal = DIV_ROUND_CLOSEST(adjusted_mode->clock * 1000, adjusted_mode->htotal * vrefresh); + adjusted_mode->vsync_start = adjusted_mode->vtotal - vsync_start_offset; + adjusted_mode->vsync_end = adjusted_mode->vtotal - vsync_end_offset; + } + drm_mode_set_crtcinfo(adjusted_mode, 0); return 0;