drm/amd/pm: pp_dpm_sclk change for smu_v13_0_7
authorKenneth Feng <kenneth.feng@amd.com>
Tue, 19 Apr 2022 06:51:36 +0000 (14:51 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 May 2022 20:53:49 +0000 (16:53 -0400)
fetch the average gfxclk according to pmfw for smu_v13_0_7

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c

index 59f0eee..d7e42cb 100644 (file)
@@ -667,10 +667,7 @@ static int smu_v13_0_7_get_smu_metrics_data(struct smu_context *smu,
                *value = metrics->CurrClock[PPCLK_FCLK];
                break;
        case METRICS_AVERAGE_GFXCLK:
-               if (metrics->AverageGfxActivity <= SMU_13_0_7_BUSY_THRESHOLD)
-                       *value = metrics->AverageGfxclkFrequencyPostDs;
-               else
-                       *value = metrics->AverageGfxclkFrequencyPreDs;
+               *value = metrics->AverageGfxclkFrequencyTarget;
                break;
        case METRICS_AVERAGE_FCLK:
                if (metrics->AverageUclkActivity <= SMU_13_0_7_BUSY_THRESHOLD)
@@ -844,7 +841,7 @@ static int smu_v13_0_7_get_current_clk_freq_by_table(struct smu_context *smu,
 
        switch (clk_id) {
        case PPCLK_GFXCLK:
-               member_type = METRICS_CURR_GFXCLK;
+               member_type = METRICS_AVERAGE_GFXCLK;
                break;
        case PPCLK_UCLK:
                member_type = METRICS_CURR_UCLK;