diff --git a/opencl/source/sharings/gl/windows/gl_arb_sync_event_windows.cpp b/opencl/source/sharings/gl/windows/gl_arb_sync_event_windows.cpp index a2c25e3784..bf9d4b779c 100644 --- a/opencl/source/sharings/gl/windows/gl_arb_sync_event_windows.cpp +++ b/opencl/source/sharings/gl/windows/gl_arb_sync_event_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Intel Corporation + * Copyright (C) 2020-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -207,6 +207,7 @@ void GlArbSyncEvent::unblockEventBy(Event &event, TaskCountType taskLevel, int32 return; } + event.getCommandQueue()->getGpgpuCommandStreamReceiver().stopDirectSubmission(true); ctx->getSharing()->glArbSyncObjectSignal(event.getCommandQueue()->getGpgpuCommandStreamReceiver().getOsContext(), *glSyncInfo); ctx->getSharing()->glArbSyncObjectWaitServer(*osInterface, *glSyncInfo); } diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_arb_sync_event_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_arb_sync_event_tests.cpp index e26fd5445f..e3360ebc58 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_arb_sync_event_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_arb_sync_event_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -222,6 +222,17 @@ TEST_F(GlArbSyncEventTest, whenGlArbSyncEventGetsUnblockedByQueuedBaseEventThenS syncEv->release(); } +TEST_F(GlArbSyncEventTest, whenUnblockCompletedEventThenStopDirectSubmission) { + auto *syncEv = new DummyArbEvent(*ctx); + syncEv->useBaseSetEvent = true; + bool ret = syncEv->setBaseEvent(*getBaseEvent()); + EXPECT_TRUE(ret); + EXPECT_FALSE(static_cast(&syncEv->getCommandQueue()->getGpgpuCommandStreamReceiver())->blockingStopDirectSubmissionCalled); + syncEv->unblockEventBy(*this->baseEvent, 0, CL_COMPLETE); + EXPECT_TRUE(static_cast(&syncEv->getCommandQueue()->getGpgpuCommandStreamReceiver())->blockingStopDirectSubmissionCalled); + syncEv->release(); +} + TEST_F(GlArbSyncEventTest, whenGlArbSyncEventGetsUnblockedBySubmittedOrCompletedEventThenSyncObjectGetsSignalled) { setWaitCalledFlagOnServerWait(); diff --git a/shared/test/common/mocks/mock_command_stream_receiver.h b/shared/test/common/mocks/mock_command_stream_receiver.h index 3851f1c53c..daaedca2b2 100644 --- a/shared/test/common/mocks/mock_command_stream_receiver.h +++ b/shared/test/common/mocks/mock_command_stream_receiver.h @@ -194,6 +194,10 @@ class MockCommandStreamReceiver : public CommandStreamReceiver { programStallingCommandsForBarrierCalled = true; } + void stopDirectSubmission(bool blocking) override { + this->blockingStopDirectSubmissionCalled = blocking; + } + bool createPreemptionAllocation() override { if (createPreemptionAllocationParentCall) { return CommandStreamReceiver::createPreemptionAllocation(); @@ -256,6 +260,7 @@ class MockCommandStreamReceiver : public CommandStreamReceiver { bool makeResidentParentCall = false; bool programComputeBarrierCommandCalled = false; bool programStallingCommandsForBarrierCalled = false; + bool blockingStopDirectSubmissionCalled = false; std::optional isGpuHangDetectedReturnValue{}; std::optional testTaskCountReadyReturnValue{}; WaitStatus waitForCompletionWithTimeoutReturnValue{WaitStatus::ready};