Skip to content

Commit a377e18

Browse files
agd5fairlied
authored andcommitted
drm/radeon/kms/r6xx+: voltage fixes
0xff01 is not an actual voltage value, but a flag for the driver. If the power state as that value, skip setting the voltage. Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
1 parent 4ee1c57 commit a377e18

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

drivers/gpu/drm/radeon/evergreen.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,17 @@ void evergreen_pm_misc(struct radeon_device *rdev)
140140
struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;
141141

142142
if (voltage->type == VOLTAGE_SW) {
143+
/* 0xff01 is a flag rather then an actual voltage */
144+
if (voltage->voltage == 0xff01)
145+
return;
143146
if (voltage->voltage && (voltage->voltage != rdev->pm.current_vddc)) {
144147
radeon_atom_set_voltage(rdev, voltage->voltage, SET_VOLTAGE_TYPE_ASIC_VDDC);
145148
rdev->pm.current_vddc = voltage->voltage;
146149
DRM_DEBUG("Setting: vddc: %d\n", voltage->voltage);
147150
}
151+
/* 0xff01 is a flag rather then an actual voltage */
152+
if (voltage->vddci == 0xff01)
153+
return;
148154
if (voltage->vddci && (voltage->vddci != rdev->pm.current_vddci)) {
149155
radeon_atom_set_voltage(rdev, voltage->vddci, SET_VOLTAGE_TYPE_ASIC_VDDCI);
150156
rdev->pm.current_vddci = voltage->vddci;

drivers/gpu/drm/radeon/r600.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,9 @@ void r600_pm_misc(struct radeon_device *rdev)
590590
struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;
591591

592592
if ((voltage->type == VOLTAGE_SW) && voltage->voltage) {
593+
/* 0xff01 is a flag rather then an actual voltage */
594+
if (voltage->voltage == 0xff01)
595+
return;
593596
if (voltage->voltage != rdev->pm.current_vddc) {
594597
radeon_atom_set_voltage(rdev, voltage->voltage, SET_VOLTAGE_TYPE_ASIC_VDDC);
595598
rdev->pm.current_vddc = voltage->voltage;

drivers/gpu/drm/radeon/radeon_atombios.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2607,6 +2607,10 @@ void radeon_atom_set_voltage(struct radeon_device *rdev, u16 voltage_level, u8 v
26072607
if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev))
26082608
return;
26092609

2610+
/* 0xff01 is a flag rather then an actual voltage */
2611+
if (voltage_level == 0xff01)
2612+
return;
2613+
26102614
switch (crev) {
26112615
case 1:
26122616
args.v1.ucVoltageType = voltage_type;

drivers/gpu/drm/radeon/rv770.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ void rv770_pm_misc(struct radeon_device *rdev)
105105
struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;
106106

107107
if ((voltage->type == VOLTAGE_SW) && voltage->voltage) {
108+
/* 0xff01 is a flag rather then an actual voltage */
109+
if (voltage->voltage == 0xff01)
110+
return;
108111
if (voltage->voltage != rdev->pm.current_vddc) {
109112
radeon_atom_set_voltage(rdev, voltage->voltage, SET_VOLTAGE_TYPE_ASIC_VDDC);
110113
rdev->pm.current_vddc = voltage->voltage;

0 commit comments

Comments
 (0)