fix: Add debug key to Force Tlb flush

Related-To: GSD-4457

Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@intel.com>
This commit is contained in:
Aravind Gopalakrishnan
2023-05-01 07:07:14 +00:00
committed by Compute-Runtime-Automation
parent 9e0aba37de
commit 1883161e1e
6 changed files with 28 additions and 2 deletions

View File

@@ -236,6 +236,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, ExitOnSubmissionNumber, -1, "Call exit(0) on X s
DECLARE_DEBUG_VARIABLE(int32_t, ExitOnSubmissionMode, 0, "Exit on X submission mode. 0: Any context type, 1: Compute context only, 2: Copy context only ")
DECLARE_DEBUG_VARIABLE(int32_t, ForceInOrderImmediateCmdListExecution, -1, "-1: default, 0: disabled, 1: all Immediate Command Lists are switched to in-order execution")
DECLARE_DEBUG_VARIABLE(int64_t, OverrideEventSynchronizeTimeout, -1, "-1: default - user provided timeout value, >0: timeout in nanoseconds")
DECLARE_DEBUG_VARIABLE(int32_t, ForceTlbFlush, -1, "-1: default, 0: Tlb flush disabled, 1: Tlb Flush enabled")
/*LOGGING FLAGS*/
DECLARE_DEBUG_VARIABLE(int32_t, PrintDriverDiagnostics, -1, "prints driver diagnostics messages to standard output, value corresponds to hint level")

View File

@@ -54,7 +54,11 @@ void ProductHelperHw<gfxProduct>::adjustSamplerState(void *sampler, const Hardwa
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::isTlbFlushRequired() const {
return true;
bool tlbFlushRequired = true;
if (DebugManager.flags.ForceTlbFlush.get() != -1) {
tlbFlushRequired = !!DebugManager.flags.ForceTlbFlush.get();
}
return tlbFlushRequired;
}
template <PRODUCT_FAMILY gfxProduct>

View File

@@ -168,7 +168,11 @@ bool ProductHelperHw<gfxProduct>::isBlitCopyRequiredForLocalMemory(const RootDev
template <>
bool ProductHelperHw<gfxProduct>::isTlbFlushRequired() const {
return false;
bool tlbFlushRequired = false;
if (DebugManager.flags.ForceTlbFlush.get() != -1) {
tlbFlushRequired = !!DebugManager.flags.ForceTlbFlush.get();
}
return tlbFlushRequired;
}
template <>

View File

@@ -519,3 +519,4 @@ DirectSubmissionControllerMaxTimeout = -1
ExitOnSubmissionNumber = -1
ExitOnSubmissionMode = 0
ForceInOrderImmediateCmdListExecution = -1
ForceTlbFlush = -1

View File

@@ -416,6 +416,16 @@ HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIfIsTimestampWaitSupport
EXPECT_FALSE(productHelper->isTimestampWaitSupportedForEvents());
}
HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIfIsTlbFlushRequiredThenTrueIsReturned, IsNotPVC) {
EXPECT_TRUE(productHelper->isTlbFlushRequired());
}
HWTEST2_F(ProductHelperTest, givenProductHelperAndForceTlbFlushNotSetWhenAskedIfIsTlbFlushRequiredThenFalseIsReturned, IsNotPVC) {
DebugManagerStateRestore restore{};
DebugManager.flags.ForceTlbFlush.set(0);
EXPECT_FALSE(productHelper->isTlbFlushRequired());
}
HWTEST_F(ProductHelperTest, givenLockableAllocationWhenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectValuesAreReturned) {
DebugManagerStateRestore restore{};

View File

@@ -32,6 +32,12 @@ PVCTEST_F(PvcProductHelper, whenCheckIsTlbFlushRequiredThenReturnProperValue) {
EXPECT_FALSE(productHelper->isTlbFlushRequired());
}
PVCTEST_F(PvcProductHelper, whenForceTlbFlushSetAndCheckIsTlbFlushRequiredThenReturnProperValue) {
DebugManagerStateRestore restore;
DebugManager.flags.ForceTlbFlush.set(1);
EXPECT_TRUE(productHelper->isTlbFlushRequired());
}
PVCTEST_F(PvcProductHelper, givenPVCRevId3AndAboveWhenGettingThreadEuRatioForScratchThen16IsReturned) {
auto hwInfo = *defaultHwInfo;
hwInfo.platform.usRevId = 3;