Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Anthony Koo <anthony.koo@amd.com>
Signed-off-by: Robin Chen <robin.chen@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Robin Chen and committed by
Alex Deucher
c03fca61 2778701b

+1 -1
+1 -1
drivers/gpu/drm/amd/display/modules/freesync/freesync.c
··· 134 134 135 135 v_total = div64_u64(div64_u64(((unsigned long long)( 136 136 frame_duration_in_ns) * (stream->timing.pix_clk_100hz / 10)), 137 - stream->timing.h_total), 1000000); 137 + stream->timing.h_total) + 500000, 1000000); 138 138 139 139 /* v_total cannot be less than nominal */ 140 140 if (v_total < stream->timing.v_total) {