drm/radeon: improve mclk param calcuations for ci dpm
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 7 Nov 2014 17:56:00 +0000 (12:56 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 12 Nov 2014 16:56:40 +0000 (11:56 -0500)
Properly take into account the post divider.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/ci_dpm.c

index 4dd8f3575238e440c4d602c4930771bbb0029fd7..3705d13218e69eacce7c34e420b7aac9bdbbec5e 100644 (file)
@@ -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;