Commit a081a9d6 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by Dave Airlie

drm/radeon/kms/r600+: use voltage from requested clock mode (v3)

This fixes FDO bug #28375, it's kind of regression, so quite important to have
it for .35.

V2: Fix on RV770+ as well. All other chipsets have only one clock mode per
state.

V3: I'm out of luck today. Grepped for voltage in r*.c and missed evergreen.

agd5f: rebased
Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexdeucher@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 4d60173f
...@@ -41,9 +41,10 @@ void evergreen_fini(struct radeon_device *rdev); ...@@ -41,9 +41,10 @@ void evergreen_fini(struct radeon_device *rdev);
void evergreen_pm_misc(struct radeon_device *rdev) void evergreen_pm_misc(struct radeon_device *rdev)
{ {
int requested_index = rdev->pm.requested_power_state_index; int req_ps_idx = rdev->pm.requested_power_state_index;
struct radeon_power_state *ps = &rdev->pm.power_state[requested_index]; int req_cm_idx = rdev->pm.requested_clock_mode_index;
struct radeon_voltage *voltage = &ps->clock_info[0].voltage; struct radeon_power_state *ps = &rdev->pm.power_state[req_ps_idx];
struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;
if ((voltage->type == VOLTAGE_SW) && voltage->voltage) { if ((voltage->type == VOLTAGE_SW) && voltage->voltage) {
if (voltage->voltage != rdev->pm.current_vddc) { if (voltage->voltage != rdev->pm.current_vddc) {
......
...@@ -557,9 +557,10 @@ void r600_pm_init_profile(struct radeon_device *rdev) ...@@ -557,9 +557,10 @@ void r600_pm_init_profile(struct radeon_device *rdev)
void r600_pm_misc(struct radeon_device *rdev) void r600_pm_misc(struct radeon_device *rdev)
{ {
int requested_index = rdev->pm.requested_power_state_index; int req_ps_idx = rdev->pm.requested_power_state_index;
struct radeon_power_state *ps = &rdev->pm.power_state[requested_index]; int req_cm_idx = rdev->pm.requested_clock_mode_index;
struct radeon_voltage *voltage = &ps->clock_info[0].voltage; struct radeon_power_state *ps = &rdev->pm.power_state[req_ps_idx];
struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;
if ((voltage->type == VOLTAGE_SW) && voltage->voltage) { if ((voltage->type == VOLTAGE_SW) && voltage->voltage) {
if (voltage->voltage != rdev->pm.current_vddc) { if (voltage->voltage != rdev->pm.current_vddc) {
......
...@@ -44,10 +44,10 @@ void rv770_fini(struct radeon_device *rdev); ...@@ -44,10 +44,10 @@ void rv770_fini(struct radeon_device *rdev);
void rv770_pm_misc(struct radeon_device *rdev) void rv770_pm_misc(struct radeon_device *rdev)
{ {
int requested_index = rdev->pm.requested_power_state_index; int req_ps_idx = rdev->pm.requested_power_state_index;
struct radeon_power_state *ps = &rdev->pm.power_state[requested_index]; int req_cm_idx = rdev->pm.requested_clock_mode_index;
struct radeon_voltage *voltage = &ps->clock_info[0].voltage; struct radeon_power_state *ps = &rdev->pm.power_state[req_ps_idx];
struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;
if ((voltage->type == VOLTAGE_SW) && voltage->voltage) { if ((voltage->type == VOLTAGE_SW) && voltage->voltage) {
if (voltage->voltage != rdev->pm.current_vddc) { if (voltage->voltage != rdev->pm.current_vddc) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment