drm/amdgpu/display: fix 64 bit divide
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 20 Sep 2019 20:13:24 +0000 (15:13 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 3 Oct 2019 14:11:00 +0000 (09:11 -0500)
Use proper helper for 32 bit.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c

index 36277bca032667ecce30ee23e4430066b1ea152d..b1e657e137a98b256195b43f056f79feb321a008 100644 (file)
@@ -197,7 +197,9 @@ void dce11_pplib_apply_display_requirements(
         */
        if (ASICREV_IS_VEGA20_P(dc->ctx->asic_id.hw_internal_rev) && (context->stream_count >= 2)) {
                pp_display_cfg->min_memory_clock_khz = max(pp_display_cfg->min_memory_clock_khz,
-                       (uint32_t) (dc->bw_vbios->high_yclk.value / memory_type_multiplier / 10000));
+                                                          (uint32_t) div64_s64(
+                                                                  div64_s64(dc->bw_vbios->high_yclk.value,
+                                                                            memory_type_multiplier), 10000));
        } else {
                pp_display_cfg->min_memory_clock_khz = context->bw_ctx.bw.dce.yclk_khz
                        / memory_type_multiplier;