Move isMidThreadPreemptionSupported helper to hwHelper

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2021-09-07 16:07:23 +00:00
committed by Compute-Runtime-Automation
parent 361a35e8a2
commit ae88789bce
12 changed files with 34 additions and 28 deletions

View File

@@ -1046,6 +1046,19 @@ HWTEST2_F(HwHelperTest, givenDefaultHwHelperHwWhenGettingIsBlitCopyRequiredForLo
EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(*defaultHwInfo, graphicsAllocation));
}
HWTEST_F(HwHelperTest, whenIsMidThreadPreemptionSupportedIsCalledThenCorrectResultIsReturned) {
auto hwInfo = *defaultHwInfo;
const auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt = true;
auto midThreadPreemptionSupported = hwHelper.isMidThreadPreemptionSupported(hwInfo);
EXPECT_TRUE(midThreadPreemptionSupported);
hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt = false;
midThreadPreemptionSupported = hwHelper.isMidThreadPreemptionSupported(hwInfo);
EXPECT_FALSE(midThreadPreemptionSupported);
}
HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, WhenIsFusedEuDispatchEnabledIsCalledThenFalseIsReturned) {
if (hardwareInfo.platform.eRenderCoreFamily == IGFX_GEN12LP_CORE) {
GTEST_SKIP();

View File

@@ -162,19 +162,6 @@ HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedForPageTableManagerSupportT
EXPECT_EQ(hwInfoConfig.isPageTableManagerSupported(pInHwInfo), UnitTestHelper<FamilyType>::isPageTableManagerSupported(pInHwInfo));
}
HWTEST_F(HwInfoConfigTest, whenIsMidThreadPreemptionSupportedIsCalledThenCorrectResultIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily);
auto hwInfo = pInHwInfo;
hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt = true;
auto midThreadPreemptionSupported = hwInfoConfig.isMidThreadPreemptionSupported(hwInfo);
EXPECT_TRUE(midThreadPreemptionSupported);
hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt = false;
midThreadPreemptionSupported = hwInfoConfig.isMidThreadPreemptionSupported(hwInfo);
EXPECT_FALSE(midThreadPreemptionSupported);
}
HWTEST_F(HwInfoConfigTest, givenVariousValuesWhenConvertingHwRevIdAndSteppingThenConversionIsCorrect) {
const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily);

View File

@@ -11,6 +11,7 @@
#include "shared/source/os_interface/os_interface.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/helpers/unit_test_helper.h"
#include "opencl/extensions/public/cl_ext_private.h"
@@ -311,13 +312,16 @@ TEST_F(HwInfoConfigTestLinuxDummy, whenConfigureHwInfoIsCalledAndPersitentContex
EXPECT_FALSE(drm->areNonPersistentContextsSupported());
}
TEST_F(HwInfoConfigTestLinuxDummy, GivenPreemptionDrmEnabledMidThreadOnWhenConfiguringHwInfoThenPreemptionIsSupported) {
HWTEST_F(HwInfoConfigTestLinuxDummy, GivenPreemptionDrmEnabledMidThreadOnWhenConfiguringHwInfoThenPreemptionIsSupported) {
pInHwInfo.capabilityTable.defaultPreemptionMode = PreemptionMode::MidThread;
drm->storedPreemptionSupport =
I915_SCHEDULER_CAP_ENABLED |
I915_SCHEDULER_CAP_PRIORITY |
I915_SCHEDULER_CAP_PREEMPTION;
drm->storedDeviceID = hwConfigTestMidThreadBit;
UnitTestHelper<FamilyType>::setExtraMidThreadPreemptionFlag(pInHwInfo);
int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, osInterface);
EXPECT_EQ(0, ret);
EXPECT_EQ(PreemptionMode::MidThread, outHwInfo.capabilityTable.defaultPreemptionMode);