aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_pm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_pm.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_pm.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 6dbfdf48a5f5..8960acf14155 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -143,50 +143,50 @@ static void radeon_get_power_state(struct radeon_device *rdev,
143 enum radeon_pm_action action) 143 enum radeon_pm_action action)
144{ 144{
145 switch (action) { 145 switch (action) {
146 case PM_ACTION_NONE:
147 default:
148 rdev->pm.requested_power_state = rdev->pm.current_power_state;
149 rdev->pm.requested_power_state->requested_clock_mode =
150 rdev->pm.requested_power_state->current_clock_mode;
151 break;
152 case PM_ACTION_MINIMUM: 146 case PM_ACTION_MINIMUM:
153 rdev->pm.requested_power_state = radeon_pick_power_state(rdev, POWER_STATE_TYPE_BATTERY); 147 rdev->pm.requested_power_state = radeon_pick_power_state(rdev, POWER_STATE_TYPE_BATTERY);
154 rdev->pm.requested_power_state->requested_clock_mode = 148 rdev->pm.requested_clock_mode =
155 radeon_pick_clock_mode(rdev, rdev->pm.requested_power_state, POWER_MODE_TYPE_LOW); 149 radeon_pick_clock_mode(rdev, rdev->pm.requested_power_state, POWER_MODE_TYPE_LOW);
156 break; 150 break;
157 case PM_ACTION_DOWNCLOCK: 151 case PM_ACTION_DOWNCLOCK:
158 rdev->pm.requested_power_state = radeon_pick_power_state(rdev, POWER_STATE_TYPE_POWERSAVE); 152 rdev->pm.requested_power_state = radeon_pick_power_state(rdev, POWER_STATE_TYPE_POWERSAVE);
159 rdev->pm.requested_power_state->requested_clock_mode = 153 rdev->pm.requested_clock_mode =
160 radeon_pick_clock_mode(rdev, rdev->pm.requested_power_state, POWER_MODE_TYPE_MID); 154 radeon_pick_clock_mode(rdev, rdev->pm.requested_power_state, POWER_MODE_TYPE_MID);
161 break; 155 break;
162 case PM_ACTION_UPCLOCK: 156 case PM_ACTION_UPCLOCK:
163 rdev->pm.requested_power_state = radeon_pick_power_state(rdev, POWER_STATE_TYPE_DEFAULT); 157 rdev->pm.requested_power_state = radeon_pick_power_state(rdev, POWER_STATE_TYPE_DEFAULT);
164 rdev->pm.requested_power_state->requested_clock_mode = 158 rdev->pm.requested_clock_mode =
165 radeon_pick_clock_mode(rdev, rdev->pm.requested_power_state, POWER_MODE_TYPE_HIGH); 159 radeon_pick_clock_mode(rdev, rdev->pm.requested_power_state, POWER_MODE_TYPE_HIGH);
166 break; 160 break;
161 case PM_ACTION_NONE:
162 default:
163 DRM_ERROR("Requested mode for not defined action\n");
164 return;
167 } 165 }
168 DRM_INFO("Requested: e: %d m: %d p: %d\n", 166 DRM_INFO("Requested: e: %d m: %d p: %d\n",
169 rdev->pm.requested_power_state->requested_clock_mode->sclk, 167 rdev->pm.requested_clock_mode->sclk,
170 rdev->pm.requested_power_state->requested_clock_mode->mclk, 168 rdev->pm.requested_clock_mode->mclk,
171 rdev->pm.requested_power_state->non_clock_info.pcie_lanes); 169 rdev->pm.requested_power_state->non_clock_info.pcie_lanes);
172} 170}
173 171
174static void radeon_set_power_state(struct radeon_device *rdev) 172static void radeon_set_power_state(struct radeon_device *rdev)
175{ 173{
176 if (rdev->pm.requested_power_state == rdev->pm.current_power_state) 174 /* if *_clock_mode are the same, *_power_state are as well */
175 if (rdev->pm.requested_clock_mode == rdev->pm.current_clock_mode)
177 return; 176 return;
178 177
179 DRM_INFO("Setting: e: %d m: %d p: %d\n", 178 DRM_INFO("Setting: e: %d m: %d p: %d\n",
180 rdev->pm.requested_power_state->requested_clock_mode->sclk, 179 rdev->pm.requested_clock_mode->sclk,
181 rdev->pm.requested_power_state->requested_clock_mode->mclk, 180 rdev->pm.requested_clock_mode->mclk,
182 rdev->pm.requested_power_state->non_clock_info.pcie_lanes); 181 rdev->pm.requested_power_state->non_clock_info.pcie_lanes);
183 /* set pcie lanes */ 182 /* set pcie lanes */
184 /* set voltage */ 183 /* set voltage */
185 /* set engine clock */ 184 /* set engine clock */
186 radeon_set_engine_clock(rdev, rdev->pm.requested_power_state->requested_clock_mode->sclk); 185 radeon_set_engine_clock(rdev, rdev->pm.requested_clock_mode->sclk);
187 /* set memory clock */ 186 /* set memory clock */
188 187
189 rdev->pm.current_power_state = rdev->pm.requested_power_state; 188 rdev->pm.current_power_state = rdev->pm.requested_power_state;
189 rdev->pm.current_clock_mode = rdev->pm.requested_clock_mode;
190} 190}
191 191
192int radeon_pm_init(struct radeon_device *rdev) 192int radeon_pm_init(struct radeon_device *rdev)