Add debug flag that overrides control of wddm evict flag

Related-To: NEO-7179

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2022-08-10 23:03:13 +00:00
committed by Compute-Runtime-Automation
parent 7d6bd45604
commit 0ecc08337e
6 changed files with 37 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ class WddmMock : public Wddm {
using Wddm::deviceRegistryPath;
using Wddm::enablePreemptionRegValue;
using Wddm::featureTable;
using Wddm::forceEvictOnlyIfNecessary;
using Wddm::getSystemInfo;
using Wddm::gmmMemory;
using Wddm::hwDeviceId;

View File

@@ -432,6 +432,7 @@ UseContextEndOffsetForEventCompletion = -1
DirectSubmissionInsertExtraMiMemFenceCommands = -1
DirectSubmissionInsertSfenceInstructionPriorToSubmission = -1
EnableTimestampWaitForEvents = -1
ForceEvictOnlyIfNecessaryFlag = -1
ForceWddmLowPriorityContextValue = -1
EnableDebuggerMmapMemoryAccess = 0
FailBuildProgramWithStatefulAccess = -1

View File

@@ -143,6 +143,22 @@ TEST_F(WddmTests, GivenDebugFlagEnablesEvictWhenNecessarySupportThenFlagIsTrue)
EXPECT_TRUE(wddm->platformSupportsEvictWhenNecessary);
}
TEST_F(WddmTests, givenDebugFlagForceEvictOnlyIfNecessaryAllValuesThenForceSettingIsSetCorrectly) {
DebugManagerStateRestore restorer{};
auto hwInfoConfig = HwInfoConfig::get(rootDeviceEnvironment->getHardwareInfo()->platform.eProductFamily);
wddm->setPlatformSupportEvictWhenNecessaryFlag(*hwInfoConfig);
EXPECT_EQ(-1, wddm->forceEvictOnlyIfNecessary);
DebugManager.flags.ForceEvictOnlyIfNecessaryFlag.set(0);
wddm->setPlatformSupportEvictWhenNecessaryFlag(*hwInfoConfig);
EXPECT_EQ(0, wddm->forceEvictOnlyIfNecessary);
DebugManager.flags.ForceEvictOnlyIfNecessaryFlag.set(1);
wddm->setPlatformSupportEvictWhenNecessaryFlag(*hwInfoConfig);
EXPECT_EQ(1, wddm->forceEvictOnlyIfNecessary);
}
TEST_F(WddmTests, GivenProperTopologyDataAndDebugFlagsEnabledWhenInitializingWddmThenExpectTopologyMapCreateAndReturnTrue) {
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
defaultHwInfo.get()->gtSystemInfo.MaxSlicesSupported = 10;
@@ -318,6 +334,19 @@ TEST_F(WddmTests, GivenPlatformSupportsEvictWhenNecessaryWhenAdjustingEvictNeede
EXPECT_FALSE(value);
}
TEST_F(WddmTests, GivenForceEvictOnlyIfNecessarySetToNotUseTheEvictFlagWhenAdjustingEvictNeededAlwaysIsFalseThenExpectTrue) {
wddm->platformSupportsEvictWhenNecessary = true;
wddm->forceEvictOnlyIfNecessary = 0;
bool value = wddm->adjustEvictNeededParameter(false);
EXPECT_TRUE(value);
}
TEST_F(WddmTests, GivenForceEvictOnlyIfNecessarySetToUseEvictFlagWhenAdjustingEvictNeededAlwaysIsTrueThenExpectFalse) {
wddm->forceEvictOnlyIfNecessary = 1;
bool value = wddm->adjustEvictNeededParameter(true);
EXPECT_FALSE(value);
}
TEST_F(WddmTests, GivenPlatformNotSupportEvictWhenNecessaryWhenAdjustingEvictNeededFalseThenExpectTrue) {
wddm->platformSupportsEvictWhenNecessary = false;
bool value = wddm->adjustEvictNeededParameter(false);