summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMikita Lipski <mikita.lipski@amd.com>2020-01-10 22:31:52 +0300
committerAlex Deucher <alexander.deucher@amd.com>2020-01-11 00:34:20 +0300
commit485b747ea6ecf491bf07c69a4ea36c0ccf3c8435 (patch)
tree58cb3c48bb1f0ba2a76f1ffce27caa3a9092ca7f /drivers
parent9edb435aed968a2c792f6d847f524587697edf37 (diff)
downloadlinux-485b747ea6ecf491bf07c69a4ea36c0ccf3c8435.tar.xz
drm/amd/display: Fix compilation warnings on i386
[why] Compilation error "undefined reference to `__udivdi3'" was thrown on i386 architecture. [how] Use div_u64 for unsigned long division instead of a divide operator. Reported-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Mikita Lipski <mikita.lipski@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 5a476028ee37..52fb207393ef 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -533,7 +533,7 @@ static int kbps_to_peak_pbn(int kbps)
u64 peak_kbps = kbps;
peak_kbps *= 1006;
- peak_kbps /= 1000;
+ peak_kbps = div_u64(peak_kbps, 1000);
return (int) DIV_ROUND_UP(peak_kbps * 64, (54 * 8 * 1000));
}
@@ -565,7 +565,7 @@ static int bpp_x16_from_pbn(struct dsc_mst_fairness_params param, int pbn)
struct dc_dsc_config dsc_config;
u64 kbps;
- kbps = (u64)pbn * 994 * 8 * 54 / 64;
+ kbps = div_u64((u64)pbn * 994 * 8 * 54, 64);
dc_dsc_compute_config(
param.sink->ctx->dc->res_pool->dscs[0],
&param.sink->sink_dsc_caps.dsc_dec_caps,