]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/amd/display: fix math_mod() using arg1 instead of arg2
authorWenjing Liu <wenjing.liu@amd.com>
Thu, 26 Mar 2026 16:00:34 +0000 (12:00 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 17 Apr 2026 19:23:49 +0000 (15:23 -0400)
commit2b104fc31be0607c04188fadbd4a9fa5b50f3b99
treed90caba6ff3987bbe4c9a82a272c2275912041fc
parentd3a549f4df7864bca8612c8bcfce1ec72b2874fb
drm/amd/display: fix math_mod() using arg1 instead of arg2

[Why]
math_mod() multiplied by arg1 instead of arg2, returning a wrong
result for any non-trivial modulo operation.

[How]
Replace arg1 with arg2 in the subtraction term to correctly
implement fmod(arg1, arg2).

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_standalone_libraries/lib_float_math.c