Skip to content

Commit 485b747

Browse files
Mikita Lipskialexdeucher
authored andcommitted
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 <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Mikita Lipski <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 9edb435 commit 485b747

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ static int kbps_to_peak_pbn(int kbps)
533533
u64 peak_kbps = kbps;
534534

535535
peak_kbps *= 1006;
536-
peak_kbps /= 1000;
536+
peak_kbps = div_u64(peak_kbps, 1000);
537537
return (int) DIV_ROUND_UP(peak_kbps * 64, (54 * 8 * 1000));
538538
}
539539

@@ -565,7 +565,7 @@ static int bpp_x16_from_pbn(struct dsc_mst_fairness_params param, int pbn)
565565
struct dc_dsc_config dsc_config;
566566
u64 kbps;
567567

568-
kbps = (u64)pbn * 994 * 8 * 54 / 64;
568+
kbps = div_u64((u64)pbn * 994 * 8 * 54, 64);
569569
dc_dsc_compute_config(
570570
param.sink->ctx->dc->res_pool->dscs[0],
571571
&param.sink->sink_dsc_caps.dsc_dec_caps,

0 commit comments

Comments
 (0)