return ret;
}
- ret = smu_get_power_limit(smu, &smu->default_power_limit, false, false);
+ ret = smu_get_asic_power_limits(smu);
if (ret) {
- dev_err(adev->dev, "Failed to get default power limit!\n");
+ dev_err(adev->dev, "Failed to get asic power limits!\n");
return ret;
}
mutex_lock(&smu->mutex);
}
- if (smu->ppt_funcs->get_power_limit)
- ret = smu->ppt_funcs->get_power_limit(smu, limit, def);
+ *limit = (def ? smu->max_power_limit : smu->current_power_limit);
if (lock_needed)
mutex_unlock(&smu->mutex);
return 0;
}
-static int arcturus_get_power_limit(struct smu_context *smu,
- uint32_t *limit,
- bool cap)
+static int arcturus_get_power_limit(struct smu_context *smu)
{
struct smu_11_0_powerplay_table *powerplay_table =
(struct smu_11_0_powerplay_table *)smu->smu_table.power_play_table;
}
smu->max_power_limit = power_limit;
- *limit = (cap ? smu->max_power_limit : smu->current_power_limit);
-
return 0;
}
int (*set_performance_level)(struct smu_context *smu, enum amd_dpm_forced_level level);
int (*display_disable_memory_clock_switch)(struct smu_context *smu, bool disable_memory_clock_switch);
void (*dump_pptable)(struct smu_context *smu);
- int (*get_power_limit)(struct smu_context *smu, uint32_t *limit, bool asic_default);
+ int (*get_power_limit)(struct smu_context *smu);
int (*get_dpm_clk_limited)(struct smu_context *smu, enum smu_clk_type clk_type,
uint32_t dpm_level, uint32_t *freq);
int (*set_df_cstate)(struct smu_context *smu, enum pp_df_cstate state);
return pptable->SocketPowerLimitAc[PPT_THROTTLER_PPT0];
}
-static int navi10_get_power_limit(struct smu_context *smu,
- uint32_t *limit,
- bool cap)
+static int navi10_get_power_limit(struct smu_context *smu)
{
struct smu_11_0_powerplay_table *powerplay_table =
(struct smu_11_0_powerplay_table *)smu->smu_table.power_play_table;
}
smu->max_power_limit = power_limit;
- *limit = (cap ? smu->max_power_limit : smu->current_power_limit);
-
return 0;
}
return pptable->SocketPowerLimitAc[PPT_THROTTLER_PPT0];
}
-static int sienna_cichlid_get_power_limit(struct smu_context *smu,
- uint32_t *limit,
- bool cap)
+static int sienna_cichlid_get_power_limit(struct smu_context *smu)
{
struct smu_11_0_7_powerplay_table *powerplay_table =
(struct smu_11_0_7_powerplay_table *)smu->smu_table.power_play_table;
}
smu->max_power_limit = power_limit;
- *limit = (cap ? smu->max_power_limit : smu->current_power_limit);
-
return 0;
}
#define smu_log_thermal_throttling(smu) \
((smu)->ppt_funcs->log_thermal_throttling_event ? (smu)->ppt_funcs->log_thermal_throttling_event((smu)) : 0)
+#define smu_get_asic_power_limits(smu) \
+ ((smu)->ppt_funcs->get_power_limit ? (smu)->ppt_funcs->get_power_limit((smu)) : 0)
+
#endif