fix: update fence values when residency list passed to switch ring buffer

Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
Maciej Plewka 2025-03-20 14:24:55 +00:00 committed by Compute-Runtime-Automation
parent 8a85a96ed2
commit 1b7bf690d2
2 changed files with 19 additions and 5 deletions

View File

@ -128,9 +128,13 @@ void WddmDirectSubmission<GfxFamily, Dispatcher>::handleStopRingBuffer() {
template <typename GfxFamily, typename Dispatcher>
void WddmDirectSubmission<GfxFamily, Dispatcher>::handleSwitchRingBuffers(ResidencyContainer *allocationsForResidency) {
if (this->disableMonitorFence) {
if (allocationsForResidency) {
auto lock = osContextWin->getResidencyController().acquireLock();
updateTagValueImpl(this->previousRingBuffer);
updateMonitorFenceValueForResidencyList(allocationsForResidency);
} else {
updateTagValueImpl(this->previousRingBuffer);
}
}
}

View File

@ -1131,11 +1131,20 @@ HWTEST_F(WddmDirectSubmissionTest, givenResidencyControllerWhenUpdatingResidency
EXPECT_EQ(mockGa.updateCompletionDataForAllocationAndFragmentsCalledtimes, 1u);
}
HWTEST_F(WddmDirectSubmissionTest, givenDirectSubmissionWhenSwitchingRingBuffersThenUpdateResidencyCalled) {
HWTEST_F(WddmDirectSubmissionTest, givenDirectSubmissionWhenSwitchingRingBuffersAndResidencyContainerIsNullThenUpdateResidencyNotCalled) {
using Dispatcher = RenderDispatcher<FamilyType>;
MockWddmDirectSubmission<FamilyType, Dispatcher> wddmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
wddmDirectSubmission.handleSwitchRingBuffers(nullptr);
EXPECT_EQ(wddmDirectSubmission.updateMonitorFenceValueForResidencyListCalled, 0u);
}
HWTEST_F(WddmDirectSubmissionTest, givenDirectSubmissionWhenSwitchingRingBuffersThenUpdateResidencyCalled) {
using Dispatcher = RenderDispatcher<FamilyType>;
MockWddmDirectSubmission<FamilyType, Dispatcher> wddmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
ResidencyContainer container;
wddmDirectSubmission.handleSwitchRingBuffers(&container);
EXPECT_EQ(wddmDirectSubmission.updateMonitorFenceValueForResidencyListCalled, 1u);
}
@ -1157,7 +1166,8 @@ HWTEST_F(WddmDirectSubmissionTest, givenDirectSubmissionWhenSwitchingRingBuffers
MyMockWddmDirectSubmission<FamilyType, Dispatcher> wddmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
std::thread th([&]() {
wddmDirectSubmission.handleSwitchRingBuffers(nullptr);
ResidencyContainer container;
wddmDirectSubmission.handleSwitchRingBuffers(&container);
});
while (!wddmDirectSubmission.lockInTesting)
;