Skip to content

Commit

Permalink
drm/amd/display: Fix compilation warnings on i386
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
Mikita Lipski authored and Alex Deucher committed Jan 10, 2020
1 parent 9edb435 commit 485b747
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
Original file line number Diff line number Diff line change
@@ -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,

0 comments on commit 485b747

Please sign in to comment.