summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Nautiyal <ankit.k.nautiyal@intel.com>2026-06-09 08:23:25 +0530
committerAnkit Nautiyal <ankit.k.nautiyal@intel.com>2026-06-12 08:55:22 +0530
commitb28c1929d75821b29c49c284ec3dc4d0e23c193f (patch)
treea69d684dd2e66751e8540a583f6d2f16231a1ccc
parent485356a428b09d4ca864abfce4d3050eee8e16c7 (diff)
drm/i915/panel: Preserve Vtotal-Vsync distance while adjusting vtotal
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 <ankit.k.nautiyal@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patch.msgid.link/20260609025325.1128543-3-ankit.k.nautiyal@intel.com
-rw-r--r--drivers/gpu/drm/i915/display/intel_panel.c9
1 files changed, 8 insertions, 1 deletions
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;