]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
drm/amd/display: Fix frames_to_insert math
authorBayan Zabihiyan <bayan.zabihiyan@amd.com>
Wed, 10 Jul 2019 20:00:53 +0000 (16:00 -0400)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 18 Oct 2019 08:26:16 +0000 (04:26 -0400)
commit59d05a703972257b2a024a16ad30be9c5ed0d0f2
tree27c1a0a8a09ca82edf57f8d612b82ad4f27c7330
parentd955bf5baf907f13f3f9d0196303fb495cc420bf
drm/amd/display: Fix frames_to_insert math

BugLink: https://bugs.launchpad.net/bugs/1848047
[ Upstream commit a463b263032f7c98c5912207db43be1aa34a6438 ]

[Why]
The math on deciding on how many
"frames to insert" sometimes sent us over the max refresh rate.
Also integer overflow can occur if we have high refresh rates.

[How]
Instead of clipping the  frame duration such that it doesn’t go below the min,
just remove a frame from the number of frames to insert. +
Use unsigned long long for intermediate calculations to prevent
integer overflow.

Signed-off-by: Bayan Zabihiyan <bayan.zabihiyan@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/gpu/drm/amd/display/modules/freesync/freesync.c