drm/radeon/pm: move pm handling into the asic specific code
We need more control over the ordering of dpm init with
respect to the rest of the asic. Specifically, the SMC
has to be initialized before the rlc and cg/pg. The pm
code currently initializes late in the driver, but we need
it to happen much earlier so move pm handling into the asic
specific callbacks.
This makes dpm more reliable and makes clockgating work
properly on CIK parts and should help on SI parts as well.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 7fc76d1..933ada0 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -1034,10 +1034,6 @@
mutex_unlock(&rdev->pm.mutex);
if (ret)
goto dpm_resume_fail;
- ret = radeon_pm_late_init(rdev);
- if (ret)
- goto dpm_resume_fail;
-
rdev->pm.dpm_enabled = true;
radeon_pm_compute_clocks(rdev);
return;
@@ -1178,11 +1174,7 @@
mutex_unlock(&rdev->pm.mutex);
if (ret)
goto dpm_failed;
- ret = radeon_pm_late_init(rdev);
- if (ret)
- goto dpm_failed;
rdev->pm.dpm_enabled = true;
- radeon_pm_compute_clocks(rdev);
ret = device_create_file(rdev->dev, &dev_attr_power_dpm_state);
if (ret)
@@ -1441,6 +1433,9 @@
struct drm_crtc *crtc;
struct radeon_crtc *radeon_crtc;
+ if (!rdev->pm.dpm_enabled)
+ return;
+
mutex_lock(&rdev->pm.mutex);
/* update active crtc counts */