]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
Merge remote-tracking branches 'asoc/topic/tlv320aic3x', 'asoc/topic/topology', ...
[linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_dpm.c
index 14f57d9915e3fc0aa8d5a8e77b734073f05ecb9b..6ca0333ca4c0f5398cfac5197c216164b39a49b2 100644 (file)
@@ -553,9 +553,10 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev)
                                entry = (ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record *)
                                        ((u8 *)entry + sizeof(ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record));
                        }
-                       for (i = 0; i < states->numEntries; i++) {
-                               if (i >= AMDGPU_MAX_VCE_LEVELS)
-                                       break;
+                       adev->pm.dpm.num_of_vce_states =
+                                       states->numEntries > AMD_MAX_VCE_LEVELS ?
+                                       AMD_MAX_VCE_LEVELS : states->numEntries;
+                       for (i = 0; i < adev->pm.dpm.num_of_vce_states; i++) {
                                vce_clk = (VCEClockInfo *)
                                        ((u8 *)&array->entries[0] +
                                         (state_entry->ucVCEClockInfoIndex * sizeof(VCEClockInfo)));
@@ -955,3 +956,12 @@ u8 amdgpu_encode_pci_lane_width(u32 lanes)
 
        return encoded_lanes[lanes];
 }
+
+struct amd_vce_state*
+amdgpu_get_vce_clock_state(struct amdgpu_device *adev, unsigned idx)
+{
+       if (idx < adev->pm.dpm.num_of_vce_states)
+               return &adev->pm.dpm.vce_states[idx];
+
+       return NULL;
+}
This page took 0.033935 seconds and 4 git commands to generate.