]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/radeon/dpm: add late_enable for KB/KV
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 19 Dec 2013 19:03:36 +0000 (14:03 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 24 Dec 2013 22:56:34 +0000 (17:56 -0500)
Make sure interrupts are enabled
before we enable thermal interrupts.
Also, don't powergate uvd, etc. until after
the ring tests.

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

index a0e20eb963db02a2f45ef3d0860a688516cf2912..eced97975952f5c1d1e7608249eacd930e3c7b31 100644 (file)
@@ -1238,6 +1238,30 @@ int kv_dpm_enable(struct radeon_device *rdev)
        return ret;
 }
 
+int kv_dpm_late_enable(struct radeon_device *rdev)
+{
+       int ret;
+
+       if (rdev->irq.installed &&
+           r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
+               ret = kv_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
+               if (ret) {
+                       DRM_ERROR("kv_set_thermal_temperature_range failed\n");
+                       return ret;
+               }
+               rdev->irq.dpm_thermal = true;
+               radeon_irq_set(rdev);
+       }
+
+       /* powerdown unused blocks for now */
+       kv_dpm_powergate_acp(rdev, true);
+       kv_dpm_powergate_samu(rdev, true);
+       kv_dpm_powergate_vce(rdev, true);
+       kv_dpm_powergate_uvd(rdev, true);
+
+       return ret;
+}
+
 void kv_dpm_disable(struct radeon_device *rdev)
 {
        kv_smc_bapm_enable(rdev, false);
index d96dfa314a37753fc9f4ecdfb6a80b19cb2e25ca..5b14b9e8f0ab4077af88e8668f9833f7d7306f3e 100644 (file)
@@ -2169,6 +2169,7 @@ static struct radeon_asic kv_asic = {
                .init = &kv_dpm_init,
                .setup_asic = &kv_dpm_setup_asic,
                .enable = &kv_dpm_enable,
+               .late_enable = &kv_dpm_late_enable,
                .disable = &kv_dpm_disable,
                .pre_set_power_state = &kv_dpm_pre_set_power_state,
                .set_power_state = &kv_dpm_set_power_state,
index 095a4faf6d2319f2f78f6e1fbb37acac50155385..cb5ca215b11c2e130b84f91f7813a40b8c6595ba 100644 (file)
@@ -776,6 +776,7 @@ void ci_dpm_powergate_uvd(struct radeon_device *rdev, bool gate);
 
 int kv_dpm_init(struct radeon_device *rdev);
 int kv_dpm_enable(struct radeon_device *rdev);
+int kv_dpm_late_enable(struct radeon_device *rdev);
 void kv_dpm_disable(struct radeon_device *rdev);
 int kv_dpm_pre_set_power_state(struct radeon_device *rdev);
 int kv_dpm_set_power_state(struct radeon_device *rdev);