]> git.baikalelectronics.ru Git - 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)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Aug 2019 15:53:12 +0000 (10:53 -0500)
commita3f6f0b355c4c90e29af689e9019dcee65b4cb1d
treefbf78502b5025caea501a95766e4f872cdc3bc56
parent5e34dee29b86df27bc78c78fbfa15ad1da0ef0b4
drm/amd/display: Fix frames_to_insert math

[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>
drivers/gpu/drm/amd/display/modules/freesync/freesync.c