diff --git a/shared/source/os_interface/linux/drm_command_stream.inl b/shared/source/os_interface/linux/drm_command_stream.inl index 932f43eda1..024db5dc24 100644 --- a/shared/source/os_interface/linux/drm_command_stream.inl +++ b/shared/source/os_interface/linux/drm_command_stream.inl @@ -370,7 +370,7 @@ bool DrmCommandStreamReceiver::waitUserFence(TaskCountType waitValue, template bool DrmCommandStreamReceiver::isGemCloseWorkerActive() const { - return this->getMemoryManager()->peekGemCloseWorker() && !this->osContext->isInternalEngine() && this->getType() == CommandStreamReceiverType::hardware; + return this->getMemoryManager()->peekGemCloseWorker() && !this->osContext->isInternalEngine() && !this->osContext->isDirectSubmissionLightActive() && this->getType() == CommandStreamReceiverType::hardware; } template diff --git a/shared/test/unit_test/os_interface/linux/device_command_stream_tests.cpp b/shared/test/unit_test/os_interface/linux/device_command_stream_tests.cpp index 40e882a099..55ffd1cc3c 100644 --- a/shared/test/unit_test/os_interface/linux/device_command_stream_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/device_command_stream_tests.cpp @@ -114,6 +114,19 @@ HWTEST_F(DeviceCommandStreamLeaksTest, givenDefaultGemCloseWorkerWhenCsrIsCreate delete osContext; } +HWTEST_F(DeviceCommandStreamLeaksTest, givenDirectSubmissionLightWhenCsrIsCreatedThenGemCloseWorkerInactiveModeIsSelected) { + executionEnvironment->memoryManager = DrmMemoryManager::create(*executionEnvironment); + std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0, 1)); + auto osContext = OsContext::create(executionEnvironment->rootDeviceEnvironments[0]->osInterface.get(), 0, 0, + EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::regular}, PreemptionMode::ThreadGroup, 0b1)); + ptr->setupContext(*osContext); + osContext->setDirectSubmissionActive(); + auto drmCsr = (DrmCommandStreamReceiver *)ptr.get(); + + EXPECT_FALSE(drmCsr->isGemCloseWorkerActive()); + delete osContext; +} + HWTEST_F(DeviceCommandStreamLeaksTest, givenDefaultGemCloseWorkerWhenInternalCsrIsCreatedThenGemCloseWorkerInactiveModeIsSelected) { executionEnvironment->memoryManager = DrmMemoryManager::create(*executionEnvironment); std::unique_ptr ptr(DeviceCommandStreamReceiver::create(false, *executionEnvironment, 0, 1));