summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRobin Chen <robin.chen@amd.com>2024-08-23 15:00:28 +0800
committerAlex Deucher <alexander.deucher@amd.com>2024-09-18 16:15:06 -0400
commitc03fca619fc687338a3b6511fdbed94096abdf79 (patch)
treee7953e4667a4cad12986b3b91864fc99077436d8 /drivers/gpu
parent2778701b165eda674756537054d460fb4b0cf2e2 (diff)
downloadlinux-stable-c03fca619fc687338a3b6511fdbed94096abdf79.tar.gz
linux-stable-c03fca619fc687338a3b6511fdbed94096abdf79.tar.bz2
linux-stable-c03fca619fc687338a3b6511fdbed94096abdf79.zip
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/display/modules/freesync/freesync.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index a40e6590215a..bbd259cea4f4 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -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) {