From 9974d95dc3066e5d907d3d20ba8be71a1f486b28 Mon Sep 17 00:00:00 2001 From: Kamil Kopryk Date: Tue, 23 Aug 2022 15:27:39 +0000 Subject: [PATCH] Restore wait on user fence during cmdlist destoy/reset Signed-off-by: Kamil Kopryk Related-To: NEO-7156 --- shared/source/command_container/cmdcontainer.cpp | 1 + .../unit_test/command_container/command_container_tests.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/shared/source/command_container/cmdcontainer.cpp b/shared/source/command_container/cmdcontainer.cpp index 59881cc4fd..d9f66adf5f 100644 --- a/shared/source/command_container/cmdcontainer.cpp +++ b/shared/source/command_container/cmdcontainer.cpp @@ -236,6 +236,7 @@ IndirectHeap *CommandContainer::getHeapWithRequiredSizeAndAlignment(HeapType hea void CommandContainer::handleCmdBufferAllocations(size_t startIndex) { for (size_t i = startIndex; i < cmdBufferAllocations.size(); i++) { if (this->reusableAllocationList) { + this->device->getMemoryManager()->handleFenceCompletion(cmdBufferAllocations[i]); reusableAllocationList->pushFrontOne(*cmdBufferAllocations[i]); } else { this->device->getMemoryManager()->freeGraphicsMemory(cmdBufferAllocations[i]); diff --git a/shared/test/unit_test/command_container/command_container_tests.cpp b/shared/test/unit_test/command_container/command_container_tests.cpp index 46ff49be2a..34eaac5d18 100644 --- a/shared/test/unit_test/command_container/command_container_tests.cpp +++ b/shared/test/unit_test/command_container/command_container_tests.cpp @@ -219,7 +219,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWithAllocsListWhenAllocateAndReset auto cmdBuffer1 = cmdBufferAllocs[1]; cmdContainer->reset(); - EXPECT_EQ(memoryManager->handleFenceCompletionCalled, 0u); + EXPECT_EQ(memoryManager->handleFenceCompletionCalled, 1u); EXPECT_EQ(cmdBufferAllocs.size(), 1u); EXPECT_EQ(cmdBufferAllocs[0], cmdBuffer0); EXPECT_FALSE(allocList.peekIsEmpty()); @@ -231,7 +231,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWithAllocsListWhenAllocateAndReset EXPECT_TRUE(allocList.peekIsEmpty()); cmdContainer.reset(); - EXPECT_EQ(memoryManager->handleFenceCompletionCalled, 0u); + EXPECT_EQ(memoryManager->handleFenceCompletionCalled, 3u); EXPECT_FALSE(allocList.peekIsEmpty()); allocList.freeAllGraphicsAllocations(pDevice); }