diff --git a/runtime/command_stream/command_stream_receiver.cpp b/runtime/command_stream/command_stream_receiver.cpp index e67d3505c1..5c38270b1c 100644 --- a/runtime/command_stream/command_stream_receiver.cpp +++ b/runtime/command_stream/command_stream_receiver.cpp @@ -153,6 +153,10 @@ LinearStream &CommandStreamReceiver::getCS(size_t minRequiredSize) { return commandStream; } +OSInterface *CommandStreamReceiver::getOSInterface() const { + return executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface.get(); +} + void CommandStreamReceiver::cleanupResources() { waitForTaskCountAndCleanAllocationList(this->latestFlushedTaskCount, TEMPORARY_ALLOCATION); waitForTaskCountAndCleanAllocationList(this->latestFlushedTaskCount, REUSABLE_ALLOCATION); diff --git a/runtime/command_stream/command_stream_receiver.h b/runtime/command_stream/command_stream_receiver.h index 7ac360fe3b..52ba5ba331 100644 --- a/runtime/command_stream/command_stream_receiver.h +++ b/runtime/command_stream/command_stream_receiver.h @@ -92,7 +92,7 @@ class CommandStreamReceiver { MOCKABLE_VIRTUAL void waitForTaskCountAndCleanTemporaryAllocationList(uint32_t requiredTaskCount); LinearStream &getCS(size_t minRequiredSize = 1024u); - OSInterface *getOSInterface() const { return osInterface; }; + OSInterface *getOSInterface() const; ExecutionEnvironment &peekExecutionEnvironment() const { return executionEnvironment; }; MOCKABLE_VIRTUAL void setTagAllocation(GraphicsAllocation *allocation); @@ -219,7 +219,6 @@ class CommandStreamReceiver { GraphicsAllocation *preemptionAllocation = nullptr; GraphicsAllocation *debugSurface = nullptr; GraphicsAllocation *perDssBackedBuffer = nullptr; - OSInterface *osInterface = nullptr; IndirectHeap *indirectHeap[IndirectHeap::NUM_TYPES]; diff --git a/runtime/os_interface/linux/drm_command_stream.inl b/runtime/os_interface/linux/drm_command_stream.inl index 2dca21b505..a08d270d0b 100644 --- a/runtime/os_interface/linux/drm_command_stream.inl +++ b/runtime/os_interface/linux/drm_command_stream.inl @@ -39,7 +39,6 @@ DrmCommandStreamReceiver::DrmCommandStreamReceiver(ExecutionEnvironme execObjectsStorage.reserve(512); executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface->get()->setDrm(this->drm); - CommandStreamReceiver::osInterface = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface.get(); } template diff --git a/runtime/os_interface/windows/wddm_device_command_stream.inl b/runtime/os_interface/windows/wddm_device_command_stream.inl index 2cd4f3f70d..6992a49b62 100644 --- a/runtime/os_interface/windows/wddm_device_command_stream.inl +++ b/runtime/os_interface/windows/wddm_device_command_stream.inl @@ -37,8 +37,7 @@ WddmCommandStreamReceiver::WddmCommandStreamReceiver(ExecutionEnviron : BaseClass(executionEnvironment, rootDeviceIndex) { notifyAubCaptureImpl = DeviceCallbacks::notifyAubCapture; - this->osInterface = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface.get(); - this->wddm = this->osInterface->get()->getWddm(); + this->wddm = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface->get()->getWddm(); PreemptionMode preemptionMode = PreemptionHelper::getDefaultPreemptionMode(peekHwInfo()); diff --git a/unit_tests/mocks/mock_csr.cpp b/unit_tests/mocks/mock_csr.cpp index 39806f13c8..53b071b504 100644 --- a/unit_tests/mocks/mock_csr.cpp +++ b/unit_tests/mocks/mock_csr.cpp @@ -7,8 +7,6 @@ #include "unit_tests/mocks/mock_csr.h" -#include "core/os_interface/os_interface.h" - bool MockCommandStreamReceiver::flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) { return true; } @@ -26,7 +24,3 @@ CompletionStamp MockCommandStreamReceiver::flushTask( CompletionStamp stamp = {taskCount, taskLevel, flushStamp->peekStamp()}; return stamp; } - -void MockCommandStreamReceiver::setOSInterface(OSInterface *osInterface) { - this->osInterface = osInterface; -} diff --git a/unit_tests/mocks/mock_csr.h b/unit_tests/mocks/mock_csr.h index 0fa31e5ebc..77e9e606ff 100644 --- a/unit_tests/mocks/mock_csr.h +++ b/unit_tests/mocks/mock_csr.h @@ -292,8 +292,6 @@ class MockCommandStreamReceiver : public CommandStreamReceiver { uint32_t blitBuffer(const BlitPropertiesContainer &blitPropertiesContainer, bool blocking) override { return taskCount; }; - void setOSInterface(OSInterface *osInterface); - CommandStreamReceiverType getType() override { return CommandStreamReceiverType::CSR_HW; } diff --git a/unit_tests/os_interface/windows/driver_info_tests.cpp b/unit_tests/os_interface/windows/driver_info_tests.cpp index 323f1d3ddf..09ab24c619 100644 --- a/unit_tests/os_interface/windows/driver_info_tests.cpp +++ b/unit_tests/os_interface/windows/driver_info_tests.cpp @@ -57,7 +57,6 @@ CommandStreamReceiver *createMockCommandStreamReceiver(bool withAubDump, Executi } EXPECT_NE(nullptr, executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface.get()); - csr->setOSInterface(executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface.get()); return csr; } diff --git a/unit_tests/sharings/gl/windows/gl_arb_sync_event_tests.cpp b/unit_tests/sharings/gl/windows/gl_arb_sync_event_tests.cpp index df3e631ea6..4d9ee1df3c 100644 --- a/unit_tests/sharings/gl/windows/gl_arb_sync_event_tests.cpp +++ b/unit_tests/sharings/gl/windows/gl_arb_sync_event_tests.cpp @@ -78,7 +78,6 @@ struct GlArbSyncEventTest : public ::testing::Test { sharing->pfnGlArbSyncObjectSignal = glArbSyncObjectSignalMockDoNothing; sharing->pfnGlArbSyncObjectWaitServer = glArbSyncObjectWaitServerMock; osInterface = new OSInterface; - mockCsr->setOSInterface(osInterface); executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(osInterface); }