aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/display/modules/freesync/freesync.c')
-rw-r--r--drivers/gpu/drm/amd/display/modules/freesync/freesync.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index daad60ec1ce3..349387eb9fe6 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -109,12 +109,6 @@ static unsigned int calc_duration_in_us_from_v_total(
109 * 1000) * stream->timing.h_total, 109 * 1000) * stream->timing.h_total,
110 stream->timing.pix_clk_khz)); 110 stream->timing.pix_clk_khz));
111 111
112 if (duration_in_us < in_vrr->min_duration_in_us)
113 duration_in_us = in_vrr->min_duration_in_us;
114
115 if (duration_in_us > in_vrr->max_duration_in_us)
116 duration_in_us = in_vrr->max_duration_in_us;
117
118 return duration_in_us; 112 return duration_in_us;
119} 113}
120 114
@@ -230,10 +224,9 @@ static void update_v_total_for_static_ramp(
230 } 224 }
231 } 225 }
232 226
233 v_total = calc_v_total_from_duration(stream, 227 v_total = div64_u64(div64_u64(((unsigned long long)(
234 in_out_vrr, 228 current_duration_in_us) * stream->timing.pix_clk_khz),
235 current_duration_in_us); 229 stream->timing.h_total), 1000);
236
237 230
238 in_out_vrr->adjust.v_total_min = v_total; 231 in_out_vrr->adjust.v_total_min = v_total;
239 in_out_vrr->adjust.v_total_max = v_total; 232 in_out_vrr->adjust.v_total_max = v_total;
@@ -702,7 +695,11 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync,
702 } else if (in_out_vrr->state == VRR_STATE_ACTIVE_FIXED) { 695 } else if (in_out_vrr->state == VRR_STATE_ACTIVE_FIXED) {
703 in_out_vrr->fixed.target_refresh_in_uhz = 696 in_out_vrr->fixed.target_refresh_in_uhz =
704 in_out_vrr->min_refresh_in_uhz; 697 in_out_vrr->min_refresh_in_uhz;
705 if (in_out_vrr->fixed.ramping_active) { 698 if (in_out_vrr->fixed.ramping_active &&
699 in_out_vrr->fixed.fixed_active) {
700 /* Do not update vtotals if ramping is already active
701 * in order to continue ramp from current refresh.
702 */
706 in_out_vrr->fixed.fixed_active = true; 703 in_out_vrr->fixed.fixed_active = true;
707 } else { 704 } else {
708 in_out_vrr->fixed.fixed_active = true; 705 in_out_vrr->fixed.fixed_active = true;