Fix setting perf factor for media

Related-To: LOCI-3554

Signed-off-by: Mayank Raghuwanshi <mayank.raghuwanshi@intel.com>
This commit is contained in:
Mayank Raghuwanshi
2022-11-11 09:53:17 +00:00
committed by Compute-Runtime-Automation
parent 0f84df6f10
commit eacf42455d
2 changed files with 8 additions and 2 deletions

View File

@@ -114,13 +114,13 @@ ze_result_t LinuxPerformanceImp::osPerformanceSetConfig(double pFactor) {
break;
case ZES_ENGINE_TYPE_FLAG_MEDIA:
if (productFamily == IGFX_PVC) {
if (pFactor >= halfOfMaxPerformanceFactor) {
if (pFactor > halfOfMaxPerformanceFactor) {
multiplier = 1;
} else {
multiplier = 0.5;
}
} else {
if (pFactor >= halfOfMaxPerformanceFactor) {
if (pFactor > halfOfMaxPerformanceFactor) {
multiplier = 1;
} else if (pFactor > minPerformanceFactor) {
multiplier = 0.5;

View File

@@ -237,6 +237,12 @@ HWTEST2_F(ZesPerformanceFixture, GivenValidPerfHandleWhenSettingMediaConfigAndGe
EXPECT_EQ(ZE_RESULT_SUCCESS, zesPerformanceFactorGetConfig(handle, &getFactor));
EXPECT_DOUBLE_EQ(std::round(getFactor), halfOfMaxPerformanceFactor);
setFactor = 50;
getFactor = 0;
EXPECT_EQ(ZE_RESULT_SUCCESS, zesPerformanceFactorSetConfig(handle, setFactor));
EXPECT_EQ(ZE_RESULT_SUCCESS, zesPerformanceFactorGetConfig(handle, &getFactor));
EXPECT_DOUBLE_EQ(std::round(getFactor), halfOfMaxPerformanceFactor);
setFactor = 60;
EXPECT_EQ(ZE_RESULT_SUCCESS, zesPerformanceFactorSetConfig(handle, setFactor));
EXPECT_EQ(ZE_RESULT_SUCCESS, zesPerformanceFactorGetConfig(handle, &getFactor));