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

@@ -215,6 +215,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, FailBuildProgramWithStatefulAccess, -1, "-1: def
DECLARE_DEBUG_VARIABLE(int32_t, ForceImagesSupport, -1, "-1: default, 0: disable, 1: enable. Override support for Images.")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideL1CachePolicyInSurfaceStateAndStateless, -1, "-1: default, >=0 : following policy will be programmed in render surface state (for regular buffers) and stateless L1 caching")
DECLARE_DEBUG_VARIABLE(int32_t, PlaformSupportEvictWhenNecessaryFlag, -1, "-1: default - platform specific, 0: disable, 1: enable")
DECLARE_DEBUG_VARIABLE(int32_t, ForceEvictOnlyIfNecessaryFlag, -1, "-1: default - driver selects when to use, 0: force never use this flag, 1: force always use this flag")
/*LOGGING FLAGS*/
DECLARE_DEBUG_VARIABLE(int32_t, PrintDriverDiagnostics, -1, "prints driver diagnostics messages to standard output, value corresponds to hint level")

View File

@@ -147,6 +147,7 @@ void Wddm::setPlatformSupportEvictWhenNecessaryFlag(const HwInfoConfig &hwInfoCo
if (overridePlatformSupportsEvictWhenNecessary != -1) {
platformSupportsEvictWhenNecessary = !!overridePlatformSupportsEvictWhenNecessary;
}
forceEvictOnlyIfNecessary = DebugManager.flags.ForceEvictOnlyIfNecessaryFlag.get();
}
bool Wddm::buildTopologyMapping() {

View File

@@ -232,6 +232,9 @@ class Wddm : public DriverModel {
if (evictNeeded == false && platformSupportsEvictWhenNecessary == false) {
evictNeeded = true;
}
if (forceEvictOnlyIfNecessary != -1) {
evictNeeded = !forceEvictOnlyIfNecessary;
}
return evictNeeded;
}
void setPlatformSupportEvictWhenNecessaryFlag(const HwInfoConfig &hwInfoConfig);
@@ -278,6 +281,7 @@ class Wddm : public DriverModel {
uint32_t maxRenderFrequency = 0;
uint32_t timestampFrequency = 0u;
uint32_t additionalAdapterInfoOptions = 0u;
int32_t forceEvictOnlyIfNecessary = -1;
unsigned int enablePreemptionRegValue = 1;

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);