From f5cda5ba5338884d920bbd5bc43282c4ee319455 Mon Sep 17 00:00:00 2001 From: Compute-Runtime-Validation Date: Sat, 30 Nov 2024 22:04:38 +0100 Subject: [PATCH] Revert "fix: call flushMonitorFence on BCS CSR" This reverts commit fc8aa8246b7aac2e519de4ea4d38ce164d83dee3. Signed-off-by: Compute-Runtime-Validation --- .../windows/wddm_device_command_stream.inl | 3 +- .../windows/device_command_stream_tests.cpp | 42 ++++--------------- 2 files changed, 8 insertions(+), 37 deletions(-) diff --git a/shared/source/os_interface/windows/wddm_device_command_stream.inl b/shared/source/os_interface/windows/wddm_device_command_stream.inl index 54003c31b0..5d14e0b6fb 100644 --- a/shared/source/os_interface/windows/wddm_device_command_stream.inl +++ b/shared/source/os_interface/windows/wddm_device_command_stream.inl @@ -189,10 +189,9 @@ template void WddmCommandStreamReceiver::flushMonitorFence() { if (this->directSubmission.get()) { this->directSubmission->flushMonitorFence(); - } else if (this->blitterDirectSubmission.get()) { - this->blitterDirectSubmission->flushMonitorFence(); } } + template void WddmCommandStreamReceiver::kmDafLockAllocations(ResidencyContainer &allocationsForResidency) { for (auto &graphicsAllocation : allocationsForResidency) { diff --git a/shared/test/unit_test/os_interface/windows/device_command_stream_tests.cpp b/shared/test/unit_test/os_interface/windows/device_command_stream_tests.cpp index 4065658324..cc8b59feb5 100644 --- a/shared/test/unit_test/os_interface/windows/device_command_stream_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/device_command_stream_tests.cpp @@ -1103,10 +1103,10 @@ HWTEST_F(WddmCsrCompressionTests, givenDisabledCompressionWhenFlushingThenDontIn memoryManager->freeGraphicsMemory(graphicsAllocation); } -template -struct MockWddmDrmDirectSubmissionDispatchCommandBuffer : public MockWddmDirectSubmission { - MockWddmDrmDirectSubmissionDispatchCommandBuffer(const CommandStreamReceiver &commandStreamReceiver) - : MockWddmDirectSubmission(commandStreamReceiver) { +template +struct MockWddmDrmDirectSubmissionDispatchCommandBuffer : public MockWddmDirectSubmission> { + MockWddmDrmDirectSubmissionDispatchCommandBuffer(const CommandStreamReceiver &commandStreamReceiver) + : MockWddmDirectSubmission>(commandStreamReceiver) { } bool dispatchCommandBuffer(BatchBuffer &batchBuffer, FlushStampTracker &flushStamp) override { @@ -1123,8 +1123,7 @@ struct MockWddmDrmDirectSubmissionDispatchCommandBuffer : public MockWddmDirectS }; HWTEST_TEMPLATED_F(WddmCommandStreamMockGdiTest, givenCsrWhenFlushMonitorFenceThenFlushMonitorFenceOnDirectSubmission) { - using Dispatcher = RenderDispatcher; - using MockSubmission = MockWddmDrmDirectSubmissionDispatchCommandBuffer; + using MockSubmission = MockWddmDrmDirectSubmissionDispatchCommandBuffer; auto mockCsr = static_cast *>(csr); debugManager.flags.EnableDirectSubmission.set(1); @@ -1157,34 +1156,8 @@ HWTEST_TEMPLATED_F(WddmCommandStreamMockGdiTest, givenCsrWhenFlushMonitorFenceTh EXPECT_EQ(directSubmission->flushMonitorFenceCalled, 1u); } -HWTEST_TEMPLATED_F(WddmCommandStreamMockGdiTest, givenDirectSubmissionEnabledOnBcsWhenCsrFlushMonitorFenceCalledThenFlushCalled) { - using Dispatcher = BlitterDispatcher; - using MockSubmission = MockWddmDrmDirectSubmissionDispatchCommandBuffer; - - auto mockCsr = static_cast *>(csr); - OsContextWin bcsOsContext(*wddm, 0, 0, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::regular})); - bcsOsContext.ensureContextInitialized(false); - mockCsr->setupContext(bcsOsContext); - - debugManager.flags.EnableDirectSubmission.set(1); - debugManager.flags.DirectSubmissionFlatRingBuffer.set(0); - - auto hwInfo = device->getRootDeviceEnvironment().getMutableHardwareInfo(); - hwInfo->capabilityTable.directSubmissionEngines.data[aub_stream::ENGINE_BCS].engineSupported = true; - - mockCsr->blitterDirectSubmission = std::make_unique(*device->getDefaultEngine().commandStreamReceiver); - auto directSubmission = reinterpret_cast(mockCsr->blitterDirectSubmission.get()); - EXPECT_FALSE(csr->isDirectSubmissionEnabled()); - EXPECT_TRUE(csr->isBlitterDirectSubmissionEnabled()); - - EXPECT_EQ(directSubmission->flushMonitorFenceCalled, 0u); - csr->flushMonitorFence(); - EXPECT_EQ(directSubmission->flushMonitorFenceCalled, 1u); -} - HWTEST_TEMPLATED_F(WddmCommandStreamMockGdiTest, givenLastSubmittedFenceLowerThanFenceValueToWaitWhenWaitFromCpuThenFlushMonitorFence) { - using Dispatcher = RenderDispatcher; - using MockSubmission = MockWddmDrmDirectSubmissionDispatchCommandBuffer; + using MockSubmission = MockWddmDrmDirectSubmissionDispatchCommandBuffer; auto mockCsr = static_cast *>(csr); debugManager.flags.EnableDirectSubmission.set(1); @@ -1224,8 +1197,7 @@ HWTEST_TEMPLATED_F(WddmCommandStreamMockGdiTest, givenLastSubmittedFenceLowerTha } HWTEST_TEMPLATED_F(WddmCommandStreamMockGdiTest, givenDirectSubmissionFailsThenFlushReturnsError) { - using Dispatcher = RenderDispatcher; - using MockSubmission = MockWddmDrmDirectSubmissionDispatchCommandBuffer; + using MockSubmission = MockWddmDrmDirectSubmissionDispatchCommandBuffer; auto mockCsr = static_cast *>(csr); bool renderStreamerFound = false;