fix: Do not update ulls tag when ring not started

When ring is not started ulls tag update is not dispatched. Counter
should reflect that.

Resolves: GSD-11312

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2025-07-02 13:39:43 +00:00
committed by Compute-Runtime-Automation
parent 42826b562d
commit a1ec6bc243
2 changed files with 19 additions and 2 deletions

View File

@@ -257,7 +257,9 @@ size_t DrmDirectSubmission<GfxFamily, Dispatcher>::dispatchStopRingBufferSection
template <typename GfxFamily, typename Dispatcher>
void DrmDirectSubmission<GfxFamily, Dispatcher>::handleSwitchRingBuffers(ResidencyContainer *allocationsForResidency) {
if (this->disableMonitorFence) {
if (this->ringStart) {
this->currentTagData.tagValue++;
}
bool updateCompletionFences = true;
if (debugManager.flags.EnableRingSwitchTagUpdateWa.get() != -1) {

View File

@@ -1146,15 +1146,28 @@ HWTEST_F(DrmDirectSubmissionTest, givenBlitterDispatcherAndMultiTileDeviceWhenCr
bool ret = directSubmission.allocateResources();
EXPECT_TRUE(ret);
}
HWTEST_F(DrmDirectSubmissionTest, givenDrmDirectSubmissionWhenHandleSwitchRingBufferCalledThenPrevRingBufferHasUpdatedFenceValue) {
HWTEST_F(DrmDirectSubmissionTest, givenDrmDirectSubmissionStartedWhenHandleSwitchRingBufferCalledThenPrevRingBufferHasUpdatedFenceValue) {
MockDrmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> drmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
auto prevCompletionFenceVal = 1u;
auto prevRingBufferIndex = 0u;
auto newCompletionFenceValue = 10u;
drmDirectSubmission.ringStart = true;
drmDirectSubmission.currentTagData.tagValue = newCompletionFenceValue;
drmDirectSubmission.ringBuffers[prevRingBufferIndex].completionFence = prevCompletionFenceVal;
drmDirectSubmission.handleSwitchRingBuffers(nullptr);
EXPECT_EQ(drmDirectSubmission.ringBuffers[prevRingBufferIndex].completionFence, newCompletionFenceValue + 1);
drmDirectSubmission.ringStart = false;
}
HWTEST_F(DrmDirectSubmissionTest, givenDrmDirectSubmissionNotStartedWhenHandleSwitchRingBufferCalledThenPrevRingBufferHasNotUpdatedFenceValue) {
MockDrmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> drmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
auto prevCompletionFenceVal = 1u;
auto prevRingBufferIndex = 0u;
auto newCompletionFenceValue = 10u;
drmDirectSubmission.ringStart = false;
drmDirectSubmission.currentTagData.tagValue = newCompletionFenceValue;
drmDirectSubmission.ringBuffers[prevRingBufferIndex].completionFence = prevCompletionFenceVal;
drmDirectSubmission.handleSwitchRingBuffers(nullptr);
EXPECT_EQ(drmDirectSubmission.ringBuffers[prevRingBufferIndex].completionFence, newCompletionFenceValue);
}
HWTEST_F(DrmDirectSubmissionTest, givenDrmDirectSubmissionWhenEnableRingSwitchTagUpdateWaEnabledAndRingNotStartedThenCompletionFenceIsNotUpdated) {
DebugManagerStateRestore dbgRestorer;
@@ -1195,10 +1208,12 @@ HWTEST_F(DrmDirectSubmissionTest, givenDrmDirectSubmissionWhenEnableRingSwitchTa
auto prevRingBufferIndex = 0u;
auto newCompletionFenceValue = 10u;
drmDirectSubmission.ringStart = true;
drmDirectSubmission.currentTagData.tagValue = newCompletionFenceValue;
drmDirectSubmission.ringBuffers[prevRingBufferIndex].completionFence = prevCompletionFenceVal;
drmDirectSubmission.handleSwitchRingBuffers(nullptr);
EXPECT_EQ(drmDirectSubmission.ringBuffers[prevRingBufferIndex].completionFence, newCompletionFenceValue + 1);
drmDirectSubmission.ringStart = false;
}
HWTEST_F(DrmDirectSubmissionTest, givenDrmDirectSubmissionWhenGettingDefaultInputMonitorFencePolicyThenDefaultIsTrue) {