fix: Update canControl field based on set Request Support

Related-to: NEO-11443

Signed-off-by: Vishnu Khanth <vishnu.khanth.b@intel.com>
This commit is contained in:
Vishnu Khanth
2024-06-19 05:57:54 +00:00
committed by Compute-Runtime-Automation
parent c51329d098
commit 0136ef049a
13 changed files with 140 additions and 33 deletions

View File

@@ -147,7 +147,7 @@ ze_result_t LinuxPowerImp::getLimits(zes_power_sustained_limit_t *pSustained, ze
ze_result_t LinuxPowerImp::setLimits(const zes_power_sustained_limit_t *pSustained, const zes_power_burst_limit_t *pBurst, const zes_power_peak_limit_t *pPeak) {
ze_result_t result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
if ((!isSubdevice) && (pSysmanProductHelper->isPowerSetLimitSupported())) {
if (canControl) {
uint64_t val = 0;
if (pSustained != nullptr) {
@@ -238,7 +238,7 @@ ze_result_t LinuxPowerImp::getLimitsExt(uint32_t *pCount, zes_power_limit_ext_de
ze_result_t LinuxPowerImp::setLimitsExt(uint32_t *pCount, zes_power_limit_ext_desc_t *pSustained) {
ze_result_t result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
if ((!isSubdevice) && (pSysmanProductHelper->isPowerSetLimitSupported())) {
if (canControl) {
uint64_t val = 0;
for (uint32_t i = 0; i < *pCount; i++) {
if (pSustained[i].level == ZES_POWER_LEVEL_SUSTAINED) {
@@ -296,7 +296,7 @@ bool LinuxPowerImp::isPowerModuleSupported() {
if (isIntelGraphicsHwmonDir(name)) {
intelGraphicsHwmonDir = hwmonDir + "/" + tempHwmonDirEntry;
hwmonDirExists = true;
canControl = isSubdevice ? false : true;
canControl = (!isSubdevice) && (pSysmanProductHelper->isPowerSetLimitSupported());
}
}