AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Fangzhi Zuo <Jerry.Zuo@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	Roman Li <roman.li@amd.com>, Wayne Lin <wayne.lin@amd.com>,
	Tom Chung <chiahsuan.chung@amd.com>,
	"Fangzhi Zuo" <jerry.zuo@amd.com>,
	Dan Wheeler <daniel.wheeler@amd.com>, Ray Wu <Ray.Wu@amd.com>,
	Ivan Lipski <ivan.lipski@amd.com>, Alex Hung <alex.hung@amd.com>
Subject: [PATCH 03/13] drm/amd/display: Allow VRR params change if unsynced with the stream
Date: Wed, 5 Nov 2025 10:36:18 -0500	[thread overview]
Message-ID: <20251105154035.883188-4-Jerry.Zuo@amd.com> (raw)
In-Reply-To: <20251105154035.883188-1-Jerry.Zuo@amd.com>

From: Ivan Lipski <ivan.lipski@amd.com>

[Why]
When changing resolution (e.g., 4K → FHD) in mirror/clone mode with
certain monitors, the monitor blanks and loses connection due to an early
exit in vrr_settings_require_update(). The function only checks if VRR
state, fixed refresh target, or min/max refresh rate range has changed.

During mode changes, if the calculated min/max refresh values remain the
same even though the stream's v_total changed, the function returns early
without updating vrr_params.adjust.v_total_min/max, leaving the monitor's
VRR timing parameters unsynced with the new mode, causing it to blank out.

[How]
Explicitly adjust VRR parameters to the stream's nominal v_total when VRR
is supported, but inactive.

Fixes: 3fd606f57448 ("drm/amd/display: more liberal vmin/vmax update for freesync")

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
---
 .../gpu/drm/amd/display/modules/freesync/freesync.c   | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index ce421bcddcb0..1aae46d703ba 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -1260,6 +1260,17 @@ void mod_freesync_handle_v_update(struct mod_freesync *mod_freesync,
 		update_v_total_for_static_ramp(
 				core_freesync, stream, in_out_vrr);
 	}
+
+	/*
+	 * If VRR is inactive, set vtotal min and max to nominal vtotal
+	 */
+	 if (in_out_vrr->state == VRR_STATE_INACTIVE) {
+		in_out_vrr->adjust.v_total_min =
+			mod_freesync_calc_v_total_from_refresh(stream,
+				in_out_vrr->max_refresh_in_uhz);
+		in_out_vrr->adjust.v_total_max = in_out_vrr->adjust.v_total_min;
+		return;
+	}
 }
 
 unsigned long long mod_freesync_calc_nominal_field_rate(
-- 
2.43.0


  parent reply	other threads:[~2025-11-05 15:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05 15:36 [PATCH 00/13] DC Patches November 03, 2025 Fangzhi Zuo
2025-11-05 15:36 ` [PATCH 01/13] drm/amd/display: Only initialize LSDMA if it is supported in DMU Fangzhi Zuo
2025-11-05 15:36 ` [PATCH 02/13] drm/amd/display: Fix index bug for fill latency Fangzhi Zuo
2025-11-05 15:36 ` Fangzhi Zuo [this message]
2025-11-05 15:36 ` [PATCH 04/13] drm/amd/display: Add interface to capture power feature status for debug logging Fangzhi Zuo
2025-11-05 15:36 ` [PATCH 05/13] drm/amd/display: Add new SMART POWER OLED interfaces Fangzhi Zuo
2025-11-05 15:36 ` [PATCH 06/13] drm/amd/display: refactor DSC cap calculation for dcn35 Fangzhi Zuo
2025-11-05 15:36 ` [PATCH 07/13] drm/amd/display: Change lock descriptor values Fangzhi Zuo
2025-11-05 15:36 ` [PATCH 08/13] drm/amd/display: To support Replay frame skip mode Fangzhi Zuo
2025-11-05 15:36 ` [PATCH 09/13] drm/amd/display: Revert in_transfer_func_change to MED Fangzhi Zuo
2025-11-05 15:36 ` [PATCH 10/13] drm/amd/display: dynamically clock gate before and after prefetch Fangzhi Zuo
2025-11-05 15:36 ` [PATCH 11/13] drm/amd/display: Refactor HDCP Status Log Format Fangzhi Zuo
2025-11-05 15:36 ` [PATCH 12/13] drm/amd/display: [FW Promotion] Release 0.1.35.0 Fangzhi Zuo
2025-11-05 15:36 ` [PATCH 13/13] drm/amd/display: Promote DC to 3.2.358 Fangzhi Zuo
2025-11-10 14:10 ` [PATCH 00/13] DC Patches November 03, 2025 Wheeler, Daniel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251105154035.883188-4-Jerry.Zuo@amd.com \
    --to=jerry.zuo@amd.com \
    --cc=Ray.Wu@amd.com \
    --cc=alex.hung@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=chiahsuan.chung@amd.com \
    --cc=daniel.wheeler@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=ivan.lipski@amd.com \
    --cc=roman.li@amd.com \
    --cc=sunpeng.li@amd.com \
    --cc=wayne.lin@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox