aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-09-09 19:27:01 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-09-11 11:44:38 -0400
commit64d03221eed88dce7f0c1edd44a3680b595b29bd (patch)
tree039a678bc817135e4c6b93adeb39116c95b597d8 /drivers/gpu
parentef4e03658420bbf91365647615460668c2510e79 (diff)
drm/radeon/dpm: handle bapm on kb/kv
bapm is a power management feature for handling the power budget between the CPU and GPU on APUs. This patch adds support for enabling or disabling it. For now disable it by default. Enabling it properly requires quite a bit more work and will be addressed in a separate patch. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/kv_dpm.c8
-rw-r--r--drivers/gpu/drm/radeon/kv_dpm.h1
-rw-r--r--drivers/gpu/drm/radeon/kv_smc.c8
3 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c
index c87d1945a6f3..92bb998cc611 100644
--- a/drivers/gpu/drm/radeon/kv_dpm.c
+++ b/drivers/gpu/drm/radeon/kv_dpm.c
@@ -1214,6 +1214,12 @@ int kv_dpm_enable(struct radeon_device *rdev)
1214 radeon_irq_set(rdev); 1214 radeon_irq_set(rdev);
1215 } 1215 }
1216 1216
1217 ret = kv_smc_bapm_enable(rdev, false);
1218 if (ret) {
1219 DRM_ERROR("kv_smc_bapm_enable failed\n");
1220 return ret;
1221 }
1222
1217 /* powerdown unused blocks for now */ 1223 /* powerdown unused blocks for now */
1218 kv_dpm_powergate_acp(rdev, true); 1224 kv_dpm_powergate_acp(rdev, true);
1219 kv_dpm_powergate_samu(rdev, true); 1225 kv_dpm_powergate_samu(rdev, true);
@@ -1237,6 +1243,8 @@ void kv_dpm_disable(struct radeon_device *rdev)
1237 RADEON_CG_BLOCK_BIF | 1243 RADEON_CG_BLOCK_BIF |
1238 RADEON_CG_BLOCK_HDP), false); 1244 RADEON_CG_BLOCK_HDP), false);
1239 1245
1246 kv_smc_bapm_enable(rdev, false);
1247
1240 /* powerup blocks */ 1248 /* powerup blocks */
1241 kv_dpm_powergate_acp(rdev, false); 1249 kv_dpm_powergate_acp(rdev, false);
1242 kv_dpm_powergate_samu(rdev, false); 1250 kv_dpm_powergate_samu(rdev, false);
diff --git a/drivers/gpu/drm/radeon/kv_dpm.h b/drivers/gpu/drm/radeon/kv_dpm.h
index 32bb079572d7..8cef7525d7a8 100644
--- a/drivers/gpu/drm/radeon/kv_dpm.h
+++ b/drivers/gpu/drm/radeon/kv_dpm.h
@@ -192,6 +192,7 @@ int kv_send_msg_to_smc_with_parameter(struct radeon_device *rdev,
192int kv_read_smc_sram_dword(struct radeon_device *rdev, u32 smc_address, 192int kv_read_smc_sram_dword(struct radeon_device *rdev, u32 smc_address,
193 u32 *value, u32 limit); 193 u32 *value, u32 limit);
194int kv_smc_dpm_enable(struct radeon_device *rdev, bool enable); 194int kv_smc_dpm_enable(struct radeon_device *rdev, bool enable);
195int kv_smc_bapm_enable(struct radeon_device *rdev, bool enable);
195int kv_copy_bytes_to_smc(struct radeon_device *rdev, 196int kv_copy_bytes_to_smc(struct radeon_device *rdev,
196 u32 smc_start_address, 197 u32 smc_start_address,
197 const u8 *src, u32 byte_count, u32 limit); 198 const u8 *src, u32 byte_count, u32 limit);
diff --git a/drivers/gpu/drm/radeon/kv_smc.c b/drivers/gpu/drm/radeon/kv_smc.c
index 34a226d7e34a..0000b59a6d05 100644
--- a/drivers/gpu/drm/radeon/kv_smc.c
+++ b/drivers/gpu/drm/radeon/kv_smc.c
@@ -107,6 +107,14 @@ int kv_smc_dpm_enable(struct radeon_device *rdev, bool enable)
107 return kv_notify_message_to_smu(rdev, PPSMC_MSG_DPM_Disable); 107 return kv_notify_message_to_smu(rdev, PPSMC_MSG_DPM_Disable);
108} 108}
109 109
110int kv_smc_bapm_enable(struct radeon_device *rdev, bool enable)
111{
112 if (enable)
113 return kv_notify_message_to_smu(rdev, PPSMC_MSG_EnableBAPM);
114 else
115 return kv_notify_message_to_smu(rdev, PPSMC_MSG_DisableBAPM);
116}
117
110int kv_copy_bytes_to_smc(struct radeon_device *rdev, 118int kv_copy_bytes_to_smc(struct radeon_device *rdev,
111 u32 smc_start_address, 119 u32 smc_start_address,
112 const u8 *src, u32 byte_count, u32 limit) 120 const u8 *src, u32 byte_count, u32 limit)