]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amd/display: fix __udivdi3 link error
authoryanglinlin <yanglinlin@kylinos.cn>
Mon, 13 Jul 2026 03:12:28 +0000 (11:12 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 17 Jul 2026 21:39:36 +0000 (17:39 -0400)
commit54d4dee9f89e1dac1a6c2618de0bb2e3f35cc2f0
treef0efb690169d22e7bd214f871548db061b8f3094
parentb5eab15944b6b140f003af6e639a25f5c3a8ed0b
drm/amd/display: fix __udivdi3 link error

When compiling the AMDGPU display driver for 32-bit architectures,
the linker reports undefined reference to `__udivdi3` in functions
get_dp_dto_frequency_100hz() and dcn401_get_dp_dto_frequency_100hz().

This is because the code uses 64-bit division (/) on 32-bit systems,
which GCC cannot handle directly and instead tries to call the missing
__udivdi3 helper function.

Replace the raw division with div_u64(), the kernel's standard 64-bit
division helper, to avoid the link error.

Signed-off-by: Linlin Yang <yanglinlin@kylinos.cn>
Reported-by: k2ci <kernel-bot@kylinos.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 0421fc6ab3a8514e99156ff3c2cee13ee9af3fa7)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c