drm/radeon/dpm: handle voltage info fetching on hawaii
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 31 Jul 2014 22:07:17 +0000 (18:07 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 Aug 2014 12:53:47 +0000 (08:53 -0400)
Some hawaii cards use a different method to fetch the
voltage info from the vbios.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=74250

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/radeon/ci_dpm.c

index 584090ac3eb90dfb631d066e67afc7e18d889c24..022561e2870722bd56c22fa65ebaf5b9bf1987a8 100644 (file)
@@ -940,7 +940,18 @@ static void ci_get_leakage_voltages(struct radeon_device *rdev)
        pi->vddc_leakage.count = 0;
        pi->vddci_leakage.count = 0;
 
-       if (radeon_atom_get_leakage_id_from_vbios(rdev, &leakage_id) == 0) {
+       if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_EVV) {
+               for (i = 0; i < CISLANDS_MAX_LEAKAGE_COUNT; i++) {
+                       virtual_voltage_id = ATOM_VIRTUAL_VOLTAGE_ID0 + i;
+                       if (radeon_atom_get_voltage_evv(rdev, virtual_voltage_id, &vddc) != 0)
+                               continue;
+                       if (vddc != 0 && vddc != virtual_voltage_id) {
+                               pi->vddc_leakage.actual_voltage[pi->vddc_leakage.count] = vddc;
+                               pi->vddc_leakage.leakage_id[pi->vddc_leakage.count] = virtual_voltage_id;
+                               pi->vddc_leakage.count++;
+                       }
+               }
+       } else if (radeon_atom_get_leakage_id_from_vbios(rdev, &leakage_id) == 0) {
                for (i = 0; i < CISLANDS_MAX_LEAKAGE_COUNT; i++) {
                        virtual_voltage_id = ATOM_VIRTUAL_VOLTAGE_ID0 + i;
                        if (radeon_atom_get_leakage_vddc_based_on_leakage_params(rdev, &vddc, &vddci,