Commit c03fca61 authored by Robin Chen's avatar Robin Chen Committed by Alex Deucher
Browse files

drm/amd/display: Round calculated vtotal



[WHY]
The calculated vtotal may has 1 line deviation. To get precisely
vtotal number, round the vtotal result.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: default avatarAnthony Koo <anthony.koo@amd.com>
Signed-off-by: default avatarRobin Chen <robin.chen@amd.com>
Signed-off-by: default avatarAlex Hung <alex.hung@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2778701b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ unsigned int mod_freesync_calc_v_total_from_refresh(

	v_total = div64_u64(div64_u64(((unsigned long long)(
			frame_duration_in_ns) * (stream->timing.pix_clk_100hz / 10)),
			stream->timing.h_total), 1000000);
			stream->timing.h_total) + 500000, 1000000);

	/* v_total cannot be less than nominal */
	if (v_total < stream->timing.v_total) {