Commit 32e61361 authored by Ken Chalmers's avatar Ken Chalmers Committed by Alex Deucher

drm/amd/display: Fix 64-bit division for 32-bit builds

[Why]
32-bit builds break when doing 64-bit division directly.

[How]
Use the div_u64() function instead to perform the division.

Fixes: https://lists.freedesktop.org/archives/dri-devel/2018-December/201008.htmlSigned-off-by: default avatarKen Chalmers <ken.chalmers@amd.com>
Reviewed-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 785fd44c
...@@ -94,7 +94,7 @@ static void program_pix_dur(struct timing_generator *tg, uint32_t pix_clk_100hz) ...@@ -94,7 +94,7 @@ static void program_pix_dur(struct timing_generator *tg, uint32_t pix_clk_100hz)
if (pix_clk_100hz == 0) if (pix_clk_100hz == 0)
return; return;
pix_dur = 10000000000ull / pix_clk_100hz; pix_dur = div_u64(10000000000ull, pix_clk_100hz);
set_reg_field_value( set_reg_field_value(
value, value,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment