diff --git a/level_zero/core/source/cmdlist/cmdlist.cpp b/level_zero/core/source/cmdlist/cmdlist.cpp index a7df622c87..97795310e4 100644 --- a/level_zero/core/source/cmdlist/cmdlist.cpp +++ b/level_zero/core/source/cmdlist/cmdlist.cpp @@ -52,30 +52,10 @@ void CommandList::storePrintfKernel(Kernel *kernel) { void CommandList::removeHostPtrAllocations() { auto memoryManager = device ? device->getNEODevice()->getMemoryManager() : nullptr; - - bool restartDirectSubmission = !this->hostPtrMap.empty() && memoryManager && device->getNEODevice()->getRootDeviceEnvironment().getProductHelper().restartDirectSubmissionForHostptrFree(); - if (restartDirectSubmission) { - const auto &engines = memoryManager->getRegisteredEngines(device->getRootDeviceIndex()); - for (const auto &engine : engines) { - auto lock = engine.commandStreamReceiver->obtainUniqueOwnership(); - engine.commandStreamReceiver->stopDirectSubmission(false); - } - } - for (auto &allocation : hostPtrMap) { UNRECOVERABLE_IF(memoryManager == nullptr); memoryManager->freeGraphicsMemory(allocation.second); } - - if (restartDirectSubmission) { - const auto &engines = memoryManager->getRegisteredEngines(device->getRootDeviceIndex()); - for (const auto &engine : engines) { - if (engine.commandStreamReceiver->isAnyDirectSubmissionEnabled()) { - engine.commandStreamReceiver->flushTagUpdate(); - } - } - } - hostPtrMap.clear(); } diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp index 2c896e78da..989a3cc7dc 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp @@ -314,48 +314,6 @@ HWTEST2_F(CommandListCreate, device->getNEODevice()->getMemoryManager()->freeSystemMemory(cmdListHostBuffer); } -HWTEST2_F(CommandListCreate, - givenCmdListHostPointerUsedWhenRemoveHostPtrAllocationThenStopDirectSubmissions, - IsAtLeastSkl) { - const auto &engines = device->getNEODevice()->getMemoryManager()->getRegisteredEngines(device->getRootDeviceIndex()); - for (const auto &engine : engines) { - auto ultCsr = static_cast *>(engine.commandStreamReceiver); - ultCsr->callFlushTagUpdate = false; - ultCsr->directSubmissionAvailable = true; - ultCsr->callBaseStopDirectSubmission = false; - } - - auto commandList = std::make_unique<::L0::ult::CommandListCoreFamily>(); - commandList->initialize(device, NEO::EngineGroupType::renderCompute, 0u); - - size_t cmdListHostPtrSize = MemoryConstants::pageSize; - void *cmdListHostBuffer = device->getNEODevice()->getMemoryManager()->allocateSystemMemory(cmdListHostPtrSize, cmdListHostPtrSize); - - AlignedAllocationData outData = commandList->getAlignedAllocationData(device, cmdListHostBuffer, cmdListHostPtrSize, false); - ASSERT_NE(nullptr, outData.alloc); - - for (const auto &engine : engines) { - auto ultCsr = static_cast *>(engine.commandStreamReceiver); - EXPECT_FALSE(ultCsr->stopDirectSubmissionCalled); - EXPECT_FALSE(ultCsr->flushTagUpdateCalled); - } - - commandList->removeHostPtrAllocations(); - - for (const auto &engine : engines) { - auto ultCsr = static_cast *>(engine.commandStreamReceiver); - if (device->getNEODevice()->getRootDeviceEnvironment().getProductHelper().restartDirectSubmissionForHostptrFree()) { - EXPECT_TRUE(ultCsr->stopDirectSubmissionCalled); - EXPECT_TRUE(ultCsr->flushTagUpdateCalled); - } else { - EXPECT_FALSE(ultCsr->stopDirectSubmissionCalled); - EXPECT_FALSE(ultCsr->flushTagUpdateCalled); - } - } - - device->getNEODevice()->getMemoryManager()->freeSystemMemory(cmdListHostBuffer); -} - using PlatformSupport = IsWithinProducts; HWTEST2_F(CommandListCreate, givenCommandListWhenMemoryCopyRegionHavingHostMemoryWithSignalAndWaitScopeEventsUsingRenderEngineThenPipeControlsWithDcFlushIsFound, diff --git a/shared/source/os_interface/product_helper.h b/shared/source/os_interface/product_helper.h index c1c69858fa..4bbc027152 100644 --- a/shared/source/os_interface/product_helper.h +++ b/shared/source/os_interface/product_helper.h @@ -109,7 +109,6 @@ class ProductHelper { virtual bool isNewResidencyModelSupported() const = 0; virtual bool isDirectSubmissionSupported(ReleaseHelper *releaseHelper) const = 0; virtual bool isDirectSubmissionConstantCacheInvalidationNeeded(const HardwareInfo &hwInfo) const = 0; - virtual bool restartDirectSubmissionForHostptrFree() const = 0; virtual bool isAdjustDirectSubmissionTimeoutOnThrottleAndAcLineStatusEnabled() const = 0; virtual TimeoutParams getDirectSubmissionControllerTimeoutParams(bool acLineConnected, QueueThrottle queueThrottle) const = 0; virtual std::pair isPipeControlPriorToNonPipelinedStateCommandsWARequired(const HardwareInfo &hwInfo, bool isRcs, const ReleaseHelper *releaseHelper) const = 0; diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index 81f7b5aede..7be7d8bd59 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -331,11 +331,6 @@ bool ProductHelperHw::isDirectSubmissionConstantCacheInvalidationNee return false; } -template -bool ProductHelperHw::restartDirectSubmissionForHostptrFree() const { - return false; -} - template bool ProductHelperHw::isAdjustDirectSubmissionTimeoutOnThrottleAndAcLineStatusEnabled() const { return false; diff --git a/shared/source/os_interface/product_helper_hw.h b/shared/source/os_interface/product_helper_hw.h index 407390cb81..228ff5ff82 100644 --- a/shared/source/os_interface/product_helper_hw.h +++ b/shared/source/os_interface/product_helper_hw.h @@ -54,7 +54,6 @@ class ProductHelperHw : public ProductHelper { bool isNewResidencyModelSupported() const override; bool isDirectSubmissionSupported(ReleaseHelper *releaseHelper) const override; bool isDirectSubmissionConstantCacheInvalidationNeeded(const HardwareInfo &hwInfo) const override; - bool restartDirectSubmissionForHostptrFree() const override; bool isAdjustDirectSubmissionTimeoutOnThrottleAndAcLineStatusEnabled() const override; TimeoutParams getDirectSubmissionControllerTimeoutParams(bool acLineConnected, QueueThrottle queueThrottle) const override; std::pair isPipeControlPriorToNonPipelinedStateCommandsWARequired(const HardwareInfo &hwInfo, bool isRcs, const ReleaseHelper *releaseHelper) const override; diff --git a/shared/test/common/libult/ult_command_stream_receiver.h b/shared/test/common/libult/ult_command_stream_receiver.h index 951131dcf7..e608c8dec7 100644 --- a/shared/test/common/libult/ult_command_stream_receiver.h +++ b/shared/test/common/libult/ult_command_stream_receiver.h @@ -465,9 +465,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw, publ void stopDirectSubmission(bool blocking) override { stopDirectSubmissionCalled = true; stopDirectSubmissionCalledBlocking = blocking; - if (this->callBaseStopDirectSubmission) { - BaseClass::stopDirectSubmission(blocking); - } + BaseClass::stopDirectSubmission(blocking); } bool waitUserFence(TaskCountType waitValue, uint64_t hostAddress, int64_t timeout, bool userInterrupt, uint32_t externalInterruptId, GraphicsAllocation *allocForInterruptWait) override { @@ -532,7 +530,6 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw, publ bool flushBatchedSubmissionsCalled = false; bool flushTagUpdateCalled = false; bool callFlushTagUpdate = true; - bool callBaseStopDirectSubmission = true; bool initProgrammingFlagsCalled = false; bool multiOsContextCapable = false; bool memoryCompressionEnabled = false;