aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2017-09-29 10:07:40 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-10-08 20:16:28 -0400
commitc3b16f16a4dffd8516a2020ce2539ebf8b2d6e33 (patch)
treea97a0933ef95b719dff4e483a65017f3c623baad /drivers/gpu
parent79867462634836ee5c39a2cdf624719feeb189bd (diff)
drm/radeon: move ci_send_msg_to_smc to where it's used
It's used in ci_dpm.c so move it there and make it static. Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/ci_dpm.c22
-rw-r--r--drivers/gpu/drm/radeon/ci_dpm.h1
-rw-r--r--drivers/gpu/drm/radeon/ci_smc.c21
3 files changed, 22 insertions, 22 deletions
diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
index c97fbb2ab48b..7e1b04dc5593 100644
--- a/drivers/gpu/drm/radeon/ci_dpm.c
+++ b/drivers/gpu/drm/radeon/ci_dpm.c
@@ -184,6 +184,7 @@ static int ci_set_overdrive_target_tdp(struct radeon_device *rdev,
184 u32 target_tdp); 184 u32 target_tdp);
185static int ci_update_uvd_dpm(struct radeon_device *rdev, bool gate); 185static int ci_update_uvd_dpm(struct radeon_device *rdev, bool gate);
186 186
187static PPSMC_Result ci_send_msg_to_smc(struct radeon_device *rdev, PPSMC_Msg msg);
187static PPSMC_Result ci_send_msg_to_smc_with_parameter(struct radeon_device *rdev, 188static PPSMC_Result ci_send_msg_to_smc_with_parameter(struct radeon_device *rdev,
188 PPSMC_Msg msg, u32 parameter); 189 PPSMC_Msg msg, u32 parameter);
189 190
@@ -1651,6 +1652,27 @@ static int ci_notify_hw_of_power_source(struct radeon_device *rdev,
1651} 1652}
1652#endif 1653#endif
1653 1654
1655static PPSMC_Result ci_send_msg_to_smc(struct radeon_device *rdev, PPSMC_Msg msg)
1656{
1657 u32 tmp;
1658 int i;
1659
1660 if (!ci_is_smc_running(rdev))
1661 return PPSMC_Result_Failed;
1662
1663 WREG32(SMC_MESSAGE_0, msg);
1664
1665 for (i = 0; i < rdev->usec_timeout; i++) {
1666 tmp = RREG32(SMC_RESP_0);
1667 if (tmp != 0)
1668 break;
1669 udelay(1);
1670 }
1671 tmp = RREG32(SMC_RESP_0);
1672
1673 return (PPSMC_Result)tmp;
1674}
1675
1654static PPSMC_Result ci_send_msg_to_smc_with_parameter(struct radeon_device *rdev, 1676static PPSMC_Result ci_send_msg_to_smc_with_parameter(struct radeon_device *rdev,
1655 PPSMC_Msg msg, u32 parameter) 1677 PPSMC_Msg msg, u32 parameter)
1656{ 1678{
diff --git a/drivers/gpu/drm/radeon/ci_dpm.h b/drivers/gpu/drm/radeon/ci_dpm.h
index 723220ffbea2..dff2a63df38f 100644
--- a/drivers/gpu/drm/radeon/ci_dpm.h
+++ b/drivers/gpu/drm/radeon/ci_dpm.h
@@ -330,7 +330,6 @@ int ci_program_jump_on_start(struct radeon_device *rdev);
330void ci_stop_smc_clock(struct radeon_device *rdev); 330void ci_stop_smc_clock(struct radeon_device *rdev);
331void ci_start_smc_clock(struct radeon_device *rdev); 331void ci_start_smc_clock(struct radeon_device *rdev);
332bool ci_is_smc_running(struct radeon_device *rdev); 332bool ci_is_smc_running(struct radeon_device *rdev);
333PPSMC_Result ci_send_msg_to_smc(struct radeon_device *rdev, PPSMC_Msg msg);
334PPSMC_Result ci_wait_for_smc_inactive(struct radeon_device *rdev); 333PPSMC_Result ci_wait_for_smc_inactive(struct radeon_device *rdev);
335int ci_load_smc_ucode(struct radeon_device *rdev, u32 limit); 334int ci_load_smc_ucode(struct radeon_device *rdev, u32 limit);
336int ci_read_smc_sram_dword(struct radeon_device *rdev, 335int ci_read_smc_sram_dword(struct radeon_device *rdev,
diff --git a/drivers/gpu/drm/radeon/ci_smc.c b/drivers/gpu/drm/radeon/ci_smc.c
index 3356a21d97ec..371121913756 100644
--- a/drivers/gpu/drm/radeon/ci_smc.c
+++ b/drivers/gpu/drm/radeon/ci_smc.c
@@ -163,27 +163,6 @@ bool ci_is_smc_running(struct radeon_device *rdev)
163 return false; 163 return false;
164} 164}
165 165
166PPSMC_Result ci_send_msg_to_smc(struct radeon_device *rdev, PPSMC_Msg msg)
167{
168 u32 tmp;
169 int i;
170
171 if (!ci_is_smc_running(rdev))
172 return PPSMC_Result_Failed;
173
174 WREG32(SMC_MESSAGE_0, msg);
175
176 for (i = 0; i < rdev->usec_timeout; i++) {
177 tmp = RREG32(SMC_RESP_0);
178 if (tmp != 0)
179 break;
180 udelay(1);
181 }
182 tmp = RREG32(SMC_RESP_0);
183
184 return (PPSMC_Result)tmp;
185}
186
187#if 0 166#if 0
188PPSMC_Result ci_wait_for_smc_inactive(struct radeon_device *rdev) 167PPSMC_Result ci_wait_for_smc_inactive(struct radeon_device *rdev)
189{ 168{