refactor: Add flag to control DC flush

Related-To: NEO-10556

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk 2024-03-12 13:16:19 +00:00 committed by Compute-Runtime-Automation
parent 7be113df2b
commit c3f1eba24a
5 changed files with 26 additions and 2 deletions

View File

@ -255,6 +255,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, ForceInOrderImmediateCmdListExecution, -1, "-1:
DECLARE_DEBUG_VARIABLE(int32_t, ForceInOrderEvents, -1, "-1: default, 0: disabled, 1: Enable all Events as in-order, to rely on command list counter value")
DECLARE_DEBUG_VARIABLE(int32_t, EnableImplicitConvertionToCounterBasedEvents, -1, "-1: default, 0: Disable, 1: Enable. If enabled, try to convert Regular Events used on Immediate CL to CounterBased")
DECLARE_DEBUG_VARIABLE(int32_t, ForceTlbFlush, -1, "-1: default, 0: Tlb flush disabled, 1: Tlb Flush enabled")
DECLARE_DEBUG_VARIABLE(int32_t, AllowDcFlush, -1, "-1: default, 0: DC flush disabled, 1: DC flush enabled")
DECLARE_DEBUG_VARIABLE(int32_t, DebugSetMemoryDiagnosticsDelay, -1, "-1: default, >=0: delay time in minutes necessary for completion of Memory diagnostics")
DECLARE_DEBUG_VARIABLE(int32_t, EnableDeviceStateVerification, -1, "-1: default, 0: disable, 1: enable check of device state before submit on Windows")
DECLARE_DEBUG_VARIABLE(int32_t, EnableDeviceStateVerificationAfterFailedSubmission, -1, "-1: default, 0: disable, 1: enable check of device state after failed submit on Windows")

View File

@ -393,7 +393,13 @@ bool ProductHelperHw<gfxProduct>::isKmdMigrationSupported() const {
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::isDcFlushAllowed() const {
return true;
auto dcFlushAllowed = true;
if (debugManager.flags.AllowDcFlush.get() != -1) {
dcFlushAllowed = debugManager.flags.AllowDcFlush.get();
}
return dcFlushAllowed;
}
template <PRODUCT_FAMILY gfxProduct>

View File

@ -18,7 +18,13 @@ bool ProductHelperHw<gfxProduct>::isDirectSubmissionSupported(ReleaseHelper *rel
template <>
bool ProductHelperHw<gfxProduct>::isDcFlushAllowed() const {
return false;
auto dcFlushAllowed = false;
if (debugManager.flags.AllowDcFlush.get() != -1) {
dcFlushAllowed = debugManager.flags.AllowDcFlush.get();
}
return dcFlushAllowed;
}
template <>

View File

@ -268,6 +268,7 @@ UpdateTaskCountFromWait = -1
EnableTimestampWaitForQueues = -1
PreferCopyEngineForCopyBufferToBuffer = -1
EnableStaticPartitioning = -1
AllowDcFlush = -1
DisableDeepBind = 0
GpuScratchRegWriteAfterWalker = -1
GpuScratchRegWriteRegisterData = 0

View File

@ -376,6 +376,16 @@ HWTEST_F(PipeControlHelperTests, WhenIsDcFlushAllowedIsCalledThenCorrectResultIs
auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<ProductHelper>();
EXPECT_FALSE(MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(false, *mockExecutionEnvironment.rootDeviceEnvironments[0]));
EXPECT_EQ(productHelper.isDcFlushAllowed(), MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, *mockExecutionEnvironment.rootDeviceEnvironments[0]));
DebugManagerStateRestore restorer;
debugManager.flags.AllowDcFlush.set(0);
EXPECT_FALSE(MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, *mockExecutionEnvironment.rootDeviceEnvironments[0]));
EXPECT_EQ(productHelper.isDcFlushAllowed(), MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, *mockExecutionEnvironment.rootDeviceEnvironments[0]));
debugManager.flags.AllowDcFlush.set(1);
EXPECT_TRUE(MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, *mockExecutionEnvironment.rootDeviceEnvironments[0]));
EXPECT_EQ(productHelper.isDcFlushAllowed(), MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, *mockExecutionEnvironment.rootDeviceEnvironments[0]));
}
HWTEST_F(PipeControlHelperTests, WhenPipeControlPostSyncTimestampUsedThenCorrectPostSyncUsed) {