fix: program system fence address when global fence passed to ULLS

Related-To: NEO-14642

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk 2025-04-30 09:12:07 +00:00 committed by Compute-Runtime-Automation
parent f4f208421f
commit 6c2ddf1120
5 changed files with 18 additions and 5 deletions

View File

@ -492,7 +492,7 @@ bool DirectSubmissionHw<GfxFamily, Dispatcher>::initialize(bool submitOnInit) {
this->partitionConfigSet = true;
}
if (this->miMemFenceRequired && !this->systemMemoryFenceAddressSet) {
if (this->globalFenceAllocation && !this->systemMemoryFenceAddressSet) {
startBufferSize += getSizeSystemMemoryFenceAddress();
dispatchSystemMemoryFenceAddress();
@ -958,7 +958,7 @@ void DirectSubmissionHw<GfxFamily, Dispatcher>::dispatchUllsState() {
dispatchPartitionRegisterConfiguration();
this->partitionConfigSet = true;
}
if (this->miMemFenceRequired && !this->systemMemoryFenceAddressSet) {
if (this->globalFenceAllocation && !this->systemMemoryFenceAddressSet) {
dispatchSystemMemoryFenceAddress();
this->systemMemoryFenceAddressSet = true;
}

View File

@ -55,6 +55,7 @@ struct MockDirectSubmissionHw : public DirectSubmissionHw<GfxFamily, Dispatcher>
using BaseClass::getSizeSwitchRingBufferSection;
using BaseClass::getSizeSystemMemoryFenceAddress;
using BaseClass::getTagAddressValueForRingSwitch;
using BaseClass::globalFenceAllocation;
using BaseClass::hwInfo;
using BaseClass::immWritePostSyncOffset;
using BaseClass::inputMonitorFenceDispatchRequirement;

View File

@ -129,7 +129,7 @@ HWTEST_F(DirectSubmissionDispatchMiMemFenceTest, givenMiMemFenceSupportedWhenIni
EXPECT_TRUE(directSubmission.initialize(true));
EXPECT_EQ(miMemFenceSupported, directSubmission.systemMemoryFenceAddressSet);
EXPECT_EQ(directSubmission.globalFenceAllocation != nullptr, directSubmission.systemMemoryFenceAddressSet);
validateFenceProgramming<FamilyType>(directSubmission, 1, expectedSysMemFenceAddress);
}
@ -151,7 +151,7 @@ HWTEST_F(DirectSubmissionDispatchMiMemFenceTest, givenMiMemFenceSupportedWhenDis
validateFenceProgramming<FamilyType>(directSubmission, 1, expectedSysMemFenceAddress);
EXPECT_EQ(miMemFenceSupported, directSubmission.systemMemoryFenceAddressSet);
EXPECT_EQ(directSubmission.globalFenceAllocation != nullptr, directSubmission.systemMemoryFenceAddressSet);
}
HWTEST_F(DirectSubmissionDispatchMiMemFenceTest, givenMiMemFenceSupportedWhenSysMemFenceIsAlreadySentThenDontReprogram) {
@ -193,6 +193,16 @@ HWTEST_F(DirectSubmissionDispatchMiMemFenceTest, givenDebugFlagSetToFalseWhenCre
EXPECT_TRUE(directSubmission.initialize(true));
EXPECT_FALSE(directSubmission.miMemFenceRequired);
EXPECT_EQ(directSubmission.systemMemoryFenceAddressSet, directSubmission.globalFenceAllocation != nullptr);
}
HWTEST_F(DirectSubmissionDispatchMiMemFenceTest, givenNoGlobalFenceAllocationWhenInitializeThenDoNotProgramGlobalFence) {
MockDirectSubmissionHw<FamilyType, RenderDispatcher<FamilyType>> directSubmission(*pDevice->getDefaultEngine().commandStreamReceiver);
directSubmission.globalFenceAllocation = nullptr;
directSubmission.systemMemoryFenceAddressSet = false;
EXPECT_TRUE(directSubmission.initialize(true));
EXPECT_FALSE(directSubmission.systemMemoryFenceAddressSet);
}
@ -211,7 +221,7 @@ HWTEST_F(DirectSubmissionDispatchMiMemFenceTest, givenDebugFlagSetToTrueWhenCrea
EXPECT_TRUE(directSubmission.initialize(true));
EXPECT_TRUE(directSubmission.systemMemoryFenceAddressSet);
EXPECT_EQ(directSubmission.systemMemoryFenceAddressSet, directSubmission.globalFenceAllocation != nullptr);
EXPECT_TRUE(directSubmission.miMemFenceRequired);
}

View File

@ -90,6 +90,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenDirectIsInitializedAndStartedThe
debugManager.flags.DirectSubmissionInsertExtraMiMemFenceCommands.set(0);
std::unique_ptr<MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>>> wddmDirectSubmission =
std::make_unique<MockWddmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>>>(*device->getDefaultEngine().commandStreamReceiver);
wddmDirectSubmission->globalFenceAllocation = nullptr;
EXPECT_EQ(1u, wddmDirectSubmission->commandBufferHeader->NeedsMidBatchPreEmptionSupport);

View File

@ -32,6 +32,7 @@ struct MockWddmDirectSubmission : public WddmDirectSubmission<GfxFamily, Dispatc
using BaseClass::getSizeSwitchRingBufferSection;
using BaseClass::getSizeSystemMemoryFenceAddress;
using BaseClass::getTagAddressValue;
using BaseClass::globalFenceAllocation;
using BaseClass::gpuVaForAdditionalSynchronizationWA;
using BaseClass::handleCompletionFence;
using BaseClass::handleNewResourcesSubmission;