ROCm SMI LIB: Add Default GPU Power Cap

Implement default GPU power cap functionality in the LIB.

Signed-off-by: Ori Messinger <Ori.Messinger@amd.com>
Change-Id: Ia6b3420beb0e4df5559c3e6d11d0667972590b53
Šī revīzija ir iekļauta:
Ori Messinger
2021-04-01 08:04:53 -04:00
revīziju iesūtīja Harish Kasiviswanathan
vecāks 844acbc0d8
revīzija 83cd2fe4f1
4 mainīti faili ar 47 papildinājumiem un 0 dzēšanām
+24
Parādīt failu
@@ -1653,6 +1653,30 @@ rsmi_dev_energy_count_get(uint32_t dv_ind, uint64_t *power,
rsmi_status_t
rsmi_dev_power_cap_get(uint32_t dv_ind, uint32_t sensor_ind, uint64_t *cap);
/**
* @brief Get the default power cap for the device specified by @p dv_ind.
*
* @details The maximum power cap be temporarily changed by the user. However,
* this function always returns the default reset power cap. The power level
* returned through @p power will be in microWatts.
*
* @param[in] dv_ind a device index
*
* @param[inout] default_cap a pointer to a uint64_t that indicates the default
* power cap, in microwatts
* If this parameter is nullptr, this function will return
* ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,
* arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the
* provided arguments.
*
* @retval ::RSMI_STATUS_SUCCESS call was successful
* @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not
* support this function with the given arguments
* @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid
*/
rsmi_status_t
rsmi_dev_power_cap_default_get(uint32_t dv_ind, uint64_t *default_cap);
/**
* @brief Get the range of valid values for the power cap
*
@@ -63,6 +63,7 @@ enum MonitorTypes {
kMonFanRPMs,
kMonFanCntrlEnable,
kMonPowerCap,
kMonPowerCapDefault,
kMonPowerCapMax,
kMonPowerCapMin,
kMonPowerAve,