drm/radeon: set default clocks for SI when DPM is disabled
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 5 Jul 2013 17:14:30 +0000 (13:14 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 5 Jul 2013 22:08:54 +0000 (18:08 -0400)
Fix patching of vddc values for SI and enable manually forcing
clocks to default levels as per NI.

This improves the out of the box performance with SI asics.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/evergreen.c
drivers/gpu/drm/radeon/radeon_atombios.c
drivers/gpu/drm/radeon/radeon_pm.c

index 2e1de4fd29756fb7d660f527e23c4dd8f6088730..e49059dc9b8fbe8d3e4baf7d09cbd2c8355d7ed1 100644 (file)
@@ -1504,8 +1504,8 @@ void evergreen_pm_misc(struct radeon_device *rdev)
        struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;
 
        if (voltage->type == VOLTAGE_SW) {
-               /* 0xff01 is a flag rather then an actual voltage */
-               if (voltage->voltage == 0xff01)
+               /* 0xff0x are flags rather then an actual voltage */
+               if ((voltage->voltage & 0xff00) == 0xff00)
                        return;
                if (voltage->voltage && (voltage->voltage != rdev->pm.current_vddc)) {
                        radeon_atom_set_voltage(rdev, voltage->voltage, SET_VOLTAGE_TYPE_ASIC_VDDC);
@@ -1525,8 +1525,8 @@ void evergreen_pm_misc(struct radeon_device *rdev)
                        voltage = &rdev->pm.power_state[req_ps_idx].
                                clock_info[rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_cm_idx].voltage;
 
-               /* 0xff01 is a flag rather then an actual voltage */
-               if (voltage->vddci == 0xff01)
+               /* 0xff0x are flags rather then an actual voltage */
+               if ((voltage->vddci & 0xff00) == 0xff00)
                        return;
                if (voltage->vddci && (voltage->vddci != rdev->pm.current_vddci)) {
                        radeon_atom_set_voltage(rdev, voltage->vddci, SET_VOLTAGE_TYPE_ASIC_VDDCI);
index b1777d10d0b5e1cdca7d8f20d4b05903b76cf7f4..fbdaff55556bc4810437b0196b2a841be86a1f77 100644 (file)
@@ -2441,6 +2441,10 @@ static bool radeon_atombios_parse_pplib_clock_info(struct radeon_device *rdev,
        case ATOM_VIRTUAL_VOLTAGE_ID1:
        case ATOM_VIRTUAL_VOLTAGE_ID2:
        case ATOM_VIRTUAL_VOLTAGE_ID3:
+       case ATOM_VIRTUAL_VOLTAGE_ID4:
+       case ATOM_VIRTUAL_VOLTAGE_ID5:
+       case ATOM_VIRTUAL_VOLTAGE_ID6:
+       case ATOM_VIRTUAL_VOLTAGE_ID7:
                if (radeon_atom_get_max_vddc(rdev, VOLTAGE_TYPE_VDDC,
                                             rdev->pm.power_state[state_index].clock_info[mode_index].voltage.voltage,
                                             &vddc) == 0)
index ebbdb477745a08de486730b4f0c2e72edf4d2d9d..c3e5e119702db445774c4703ae4ad5b5da57565e 100644 (file)
@@ -852,7 +852,7 @@ static void radeon_pm_resume_old(struct radeon_device *rdev)
 {
        /* set up the default clocks if the MC ucode is loaded */
        if ((rdev->family >= CHIP_BARTS) &&
-           (rdev->family <= CHIP_CAYMAN) &&
+           (rdev->family <= CHIP_HAINAN) &&
            rdev->mc_fw) {
                if (rdev->pm.default_vddc)
                        radeon_atom_set_voltage(rdev, rdev->pm.default_vddc,
@@ -896,7 +896,7 @@ static void radeon_pm_resume_dpm(struct radeon_device *rdev)
        if (ret) {
                DRM_ERROR("radeon: dpm resume failed\n");
                if ((rdev->family >= CHIP_BARTS) &&
-                   (rdev->family <= CHIP_CAYMAN) &&
+                   (rdev->family <= CHIP_HAINAN) &&
                    rdev->mc_fw) {
                        if (rdev->pm.default_vddc)
                                radeon_atom_set_voltage(rdev, rdev->pm.default_vddc,
@@ -947,7 +947,7 @@ static int radeon_pm_init_old(struct radeon_device *rdev)
                radeon_pm_init_profile(rdev);
                /* set up the default clocks if the MC ucode is loaded */
                if ((rdev->family >= CHIP_BARTS) &&
-                   (rdev->family <= CHIP_CAYMAN) &&
+                   (rdev->family <= CHIP_HAINAN) &&
                    rdev->mc_fw) {
                        if (rdev->pm.default_vddc)
                                radeon_atom_set_voltage(rdev, rdev->pm.default_vddc,
@@ -1032,7 +1032,7 @@ static int radeon_pm_init_dpm(struct radeon_device *rdev)
        if (ret) {
                rdev->pm.dpm_enabled = false;
                if ((rdev->family >= CHIP_BARTS) &&
-                   (rdev->family <= CHIP_CAYMAN) &&
+                   (rdev->family <= CHIP_HAINAN) &&
                    rdev->mc_fw) {
                        if (rdev->pm.default_vddc)
                                radeon_atom_set_voltage(rdev, rdev->pm.default_vddc,