]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amd/powerplay: correct vega12 max num of dpm level
authorEvan Quan <evan.quan@amd.com>
Mon, 11 Jun 2018 08:33:40 +0000 (16:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 Jul 2018 21:38:55 +0000 (16:38 -0500)
Use MAX_NUM_CLOCKS instead of VG12_PSUEDO* macros for
the max number of dpm levels.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c

index 8222383009da1ced2a316762683b63cbfdde7b31..d1bab9845b086be8fbad871eaf56abe0b5aa1142 100644 (file)
@@ -1642,8 +1642,8 @@ static int vega12_get_sclks(struct pp_hwmgr *hwmgr,
                return -1;
 
        dpm_table = &(data->dpm_table.gfx_table);
-       ucount = (dpm_table->count > VG12_PSUEDO_NUM_GFXCLK_DPM_LEVELS) ?
-               VG12_PSUEDO_NUM_GFXCLK_DPM_LEVELS : dpm_table->count;
+       ucount = (dpm_table->count > MAX_NUM_CLOCKS) ?
+               MAX_NUM_CLOCKS : dpm_table->count;
 
        for (i = 0; i < ucount; i++) {
                clocks->data[i].clocks_in_khz =
@@ -1674,11 +1674,12 @@ static int vega12_get_memclocks(struct pp_hwmgr *hwmgr,
                return -1;
 
        dpm_table = &(data->dpm_table.mem_table);
-       ucount = (dpm_table->count > VG12_PSUEDO_NUM_UCLK_DPM_LEVELS) ?
-               VG12_PSUEDO_NUM_UCLK_DPM_LEVELS : dpm_table->count;
+       ucount = (dpm_table->count > MAX_NUM_CLOCKS) ?
+               MAX_NUM_CLOCKS : dpm_table->count;
 
        for (i = 0; i < ucount; i++) {
                clocks->data[i].clocks_in_khz =
+                       data->mclk_latency_table.entries[i].frequency =
                        dpm_table->dpm_levels[i].value * 100;
 
                clocks->data[i].latency_in_us =
@@ -1704,8 +1705,8 @@ static int vega12_get_dcefclocks(struct pp_hwmgr *hwmgr,
 
 
        dpm_table = &(data->dpm_table.dcef_table);
-       ucount = (dpm_table->count > VG12_PSUEDO_NUM_DCEFCLK_DPM_LEVELS) ?
-               VG12_PSUEDO_NUM_DCEFCLK_DPM_LEVELS : dpm_table->count;
+       ucount = (dpm_table->count > MAX_NUM_CLOCKS) ?
+               MAX_NUM_CLOCKS : dpm_table->count;
 
        for (i = 0; i < ucount; i++) {
                clocks->data[i].clocks_in_khz =
@@ -1732,8 +1733,8 @@ static int vega12_get_socclocks(struct pp_hwmgr *hwmgr,
 
 
        dpm_table = &(data->dpm_table.soc_table);
-       ucount = (dpm_table->count > VG12_PSUEDO_NUM_SOCCLK_DPM_LEVELS) ?
-               VG12_PSUEDO_NUM_SOCCLK_DPM_LEVELS : dpm_table->count;
+       ucount = (dpm_table->count > MAX_NUM_CLOCKS) ?
+               MAX_NUM_CLOCKS : dpm_table->count;
 
        for (i = 0; i < ucount; i++) {
                clocks->data[i].clocks_in_khz =