From: Ivan Lipski <[email protected]>

[Why]
FAMS2 on DCN6 uses the stream's max_vtotal to estimate the DRR prepare
time against the remaining PPT window before allowing a UCLK switch.
amdgpu_dm never set stream->timing.min/max_refresh_in_uhz, so DML
derived max_vtotal from the HW vtotal limit (~0x7FFF), causing DMUB to
incorrectly reject P-state switches.

[How]
Populate stream timing min/max refresh from the freesync config when
VRR is supported.

Cc: Jerry Zuo <[email protected]>
Signed-off-by: Ivan Lipski <[email protected]>
Signed-off-by: James Lin <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c
index 40f1dd8af21c..78dbdbce8c04 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c
@@ -187,6 +187,9 @@ void amdgpu_dm_get_freesync_config_for_crtc(
                config.vsif_supported = true;
                config.btr = true;
 
+               new_crtc_state->stream->timing.min_refresh_in_uhz = 
config.min_refresh_in_uhz;
+               new_crtc_state->stream->timing.max_refresh_in_uhz = 
config.max_refresh_in_uhz;
+
                if (fs_vid_mode) {
                        config.state = VRR_STATE_ACTIVE_FIXED;
                        config.fixed_refresh_in_uhz = 
new_crtc_state->freesync_config.fixed_refresh_in_uhz;
-- 
2.43.0

Reply via email to