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

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
...@@ -134,7 +134,7 @@ unsigned int mod_freesync_calc_v_total_from_refresh( ...@@ -134,7 +134,7 @@ unsigned int mod_freesync_calc_v_total_from_refresh(
v_total = div64_u64(div64_u64(((unsigned long long)( v_total = div64_u64(div64_u64(((unsigned long long)(
frame_duration_in_ns) * (stream->timing.pix_clk_100hz / 10)), 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 */ /* v_total cannot be less than nominal */
if (v_total < stream->timing.v_total) { if (v_total < stream->timing.v_total) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment