From: Alex Deucher Date: Fri, 7 Nov 2014 17:56:00 +0000 (-0500) Subject: drm/radeon: improve mclk param calcuations for ci dpm X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c0392f8f0971fee63fa736c800e7c32b59773ba7;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm/radeon: improve mclk param calcuations for ci dpm Properly take into account the post divider. Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c index 4dd8f3575238..3705d13218e6 100644 --- a/drivers/gpu/drm/radeon/ci_dpm.c +++ b/drivers/gpu/drm/radeon/ci_dpm.c @@ -2409,10 +2409,10 @@ static int ci_calculate_mclk_params(struct radeon_device *rdev, u32 tmp; u32 reference_clock = rdev->clock.mpll.reference_freq; - if (pi->mem_gddr5) - freq_nom = memory_clock * 4; + if (mpll_param.qdr == 1) + freq_nom = memory_clock * 4 * (1 << mpll_param.post_div); else - freq_nom = memory_clock * 2; + freq_nom = memory_clock * 2 * (1 << mpll_param.post_div); tmp = (freq_nom / reference_clock); tmp = tmp * tmp;