From 86f5555f67b361769cc61920b6be9b68c5bde95b Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Wed, 8 Apr 2020 11:45:54 +0200 Subject: [PATCH] Fill OsInterface in Wddm::init Change-Id: I0a4645040b06870007a20b46dbea562bf6024ad3 Signed-off-by: Mateusz Jablonski --- .../device/device_win_timers_tests.cpp | 4 +- .../gen12lp/windows/wddm_tests_gen12lp.cpp | 6 +-- opencl/test/unit_test/mocks/mock_wddm.cpp | 5 --- opencl/test/unit_test/mocks/mock_wddm.h | 2 - .../windows/driver_info_tests.cpp | 2 - .../windows/hw_info_config_win_tests.cpp | 2 +- .../windows/os_interface_win_tests.cpp | 2 - .../os_interface/windows/wddm20_tests.cpp | 26 +++++------- .../os_interface/windows/wddm23_tests.cpp | 7 ++-- .../windows/wddm_address_space_tests.cpp | 10 ++--- .../os_interface/windows/wddm_fixture.h | 6 ++- .../windows/wddm_kmdaf_listener_tests.cpp | 6 +-- .../windows/wddm_memory_manager_tests.cpp | 40 +++++++------------ .../windows/wddm_memory_manager_tests.h | 4 -- .../wddm_residency_controller_tests.cpp | 18 ++++----- .../gl/windows/gl_os_sharing_tests.cpp | 28 ++++++++----- .../unit_test/windows/os_interface_tests.cpp | 6 +-- .../os_interface/windows/os_interface.cpp | 2 - .../source/os_interface/windows/wddm/wddm.cpp | 4 ++ .../source/os_interface/windows/wddm/wddm.h | 2 +- 20 files changed, 78 insertions(+), 104 deletions(-) diff --git a/opencl/test/unit_test/device/device_win_timers_tests.cpp b/opencl/test/unit_test/device/device_win_timers_tests.cpp index af7884c226..e4ccc116b9 100644 --- a/opencl/test/unit_test/device/device_win_timers_tests.cpp +++ b/opencl/test/unit_test/device/device_win_timers_tests.cpp @@ -25,12 +25,12 @@ typedef ::testing::Test MockOSTimeWinTest; TEST_F(MockOSTimeWinTest, WhenCreatingTimerThenResolutionIsSetCorrectly) { MockExecutionEnvironment executionEnvironment; RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment); - auto wddmMock = std::unique_ptr(new WddmMock(rootDeviceEnvironment)); + auto wddmMock = new WddmMock(rootDeviceEnvironment); auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(nullptr)); wddmMock->init(); - std::unique_ptr timeWin(new MockOSTimeWin(wddmMock.get())); + std::unique_ptr timeWin(new MockOSTimeWin(wddmMock)); double res = 0.0; res = timeWin->getDynamicDeviceTimerResolution(device->getHardwareInfo()); diff --git a/opencl/test/unit_test/gen12lp/windows/wddm_tests_gen12lp.cpp b/opencl/test/unit_test/gen12lp/windows/wddm_tests_gen12lp.cpp index b1fd9ce9d5..bcf9297758 100644 --- a/opencl/test/unit_test/gen12lp/windows/wddm_tests_gen12lp.cpp +++ b/opencl/test/unit_test/gen12lp/windows/wddm_tests_gen12lp.cpp @@ -25,7 +25,7 @@ struct Gen12LpWddmTest : public GdiDllFixture, ::testing::Test { executionEnvironment = std::make_unique(); rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[0].get(); rootDeviceEnvironment->initGmm(); - wddm.reset(static_cast(Wddm::createWddm(nullptr, *rootDeviceEnvironment))); + wddm = static_cast(Wddm::createWddm(nullptr, *rootDeviceEnvironment)); gmmMemory = new ::testing::NiceMock(rootDeviceEnvironment->getGmmClientContext()); wddm->gmmMemory.reset(gmmMemory); } @@ -35,8 +35,8 @@ struct Gen12LpWddmTest : public GdiDllFixture, ::testing::Test { } std::unique_ptr executionEnvironment; - RootDeviceEnvironment *rootDeviceEnvironment; - std::unique_ptr wddm; + RootDeviceEnvironment *rootDeviceEnvironment = nullptr; + WddmMock *wddm = nullptr; GmockGmmMemory *gmmMemory = nullptr; }; diff --git a/opencl/test/unit_test/mocks/mock_wddm.cpp b/opencl/test/unit_test/mocks/mock_wddm.cpp index 35d6d4316c..58680cb2ec 100644 --- a/opencl/test/unit_test/mocks/mock_wddm.cpp +++ b/opencl/test/unit_test/mocks/mock_wddm.cpp @@ -300,11 +300,6 @@ void WddmMock::createPagingFenceLogger() { } } -bool WddmMock::init() { - osInterfaceAvailable = rootDeviceEnvironment.osInterface != nullptr; - return Wddm::init(); -} - void *GmockWddm::virtualAllocWrapper(void *inPtr, size_t size, uint32_t flags, uint32_t type) { void *tmp = reinterpret_cast(virtualAllocAddress); size += MemoryConstants::pageSize; diff --git a/opencl/test/unit_test/mocks/mock_wddm.h b/opencl/test/unit_test/mocks/mock_wddm.h index 2fa7801759..d33df0cea0 100644 --- a/opencl/test/unit_test/mocks/mock_wddm.h +++ b/opencl/test/unit_test/mocks/mock_wddm.h @@ -85,7 +85,6 @@ class WddmMock : public Wddm { uint64_t *getPagingFenceAddress() override; void waitOnPagingFenceFromCpu() override; void createPagingFenceLogger() override; - bool init() override; bool configureDeviceAddressSpace() { configureDeviceAddressSpaceResult.called++; @@ -135,7 +134,6 @@ class WddmMock : public Wddm { bool makeResidentStatus = true; bool callBaseMakeResident = true; bool callBaseCreatePagingLogger = true; - bool osInterfaceAvailable = false; }; struct GmockWddm : WddmMock { diff --git a/opencl/test/unit_test/os_interface/windows/driver_info_tests.cpp b/opencl/test/unit_test/os_interface/windows/driver_info_tests.cpp index 85055e0fbf..c032276136 100644 --- a/opencl/test/unit_test/os_interface/windows/driver_info_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/driver_info_tests.cpp @@ -55,10 +55,8 @@ class DriverInfoDeviceTest : public ::testing::Test { CommandStreamReceiver *createMockCommandStreamReceiver(bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { auto csr = new MockCommandStreamReceiver(executionEnvironment, rootDeviceIndex); if (!executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface) { - executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface = std::make_unique(); auto wddm = new WddmMock(*executionEnvironment.rootDeviceEnvironments[0]); wddm->init(); - executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface->get()->setWddm(wddm); } EXPECT_NE(nullptr, executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface.get()); diff --git a/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp b/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp index 13352a87f0..3a73809f3e 100644 --- a/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp @@ -65,7 +65,7 @@ void HwInfoConfigTestWindows::SetUp() { osInterface.reset(new OSInterface()); - std::unique_ptr wddm(Wddm::createWddm(nullptr, *rootDeviceEnvironment)); + auto wddm = Wddm::createWddm(nullptr, *rootDeviceEnvironment); wddm->init(); outHwInfo = *rootDeviceEnvironment->getHardwareInfo(); } diff --git a/opencl/test/unit_test/os_interface/windows/os_interface_win_tests.cpp b/opencl/test/unit_test/os_interface/windows/os_interface_win_tests.cpp index d138ca622d..840cea1a6b 100644 --- a/opencl/test/unit_test/os_interface/windows/os_interface_win_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/os_interface_win_tests.cpp @@ -28,8 +28,6 @@ TEST(OsContextTest, givenWddmWhenCreateOsContextAfterInitWddmThenOsContextIsInit MockExecutionEnvironment executionEnvironment; RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment); auto wddm = new WddmMock(rootDeviceEnvironment); - OSInterface osInterface; - osInterface.get()->setWddm(wddm); auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); wddm->init(); EXPECT_EQ(0u, wddm->registerTrimCallbackResult.called); diff --git a/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp index bbcc681a86..ab92507aaa 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp @@ -134,7 +134,7 @@ TEST(Wddm20EnumAdaptersTest, expectTrue) { MockExecutionEnvironment executionEnvironment; RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment); - std::unique_ptr wddm(Wddm::createWddm(nullptr, rootDeviceEnvironment)); + auto wddm = Wddm::createWddm(nullptr, rootDeviceEnvironment); bool success = wddm->init(); EXPECT_TRUE(success); @@ -151,7 +151,7 @@ TEST(Wddm20EnumAdaptersTest, givenEmptyHardwareInfoWhenEnumAdapterIsCalledThenCa ExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); auto rootDeviceEnvironment = executionEnvironment.rootDeviceEnvironments[0].get(); - std::unique_ptr wddm(Wddm::createWddm(nullptr, *rootDeviceEnvironment)); + auto wddm = Wddm::createWddm(nullptr, *rootDeviceEnvironment); bool success = wddm->init(); HardwareInfo outHwInfo = *rootDeviceEnvironment->getHardwareInfo(); EXPECT_TRUE(success); @@ -175,7 +175,7 @@ TEST(Wddm20EnumAdaptersTest, givenUnknownPlatformWhenEnumAdapterIsCalledThenFals MockExecutionEnvironment executionEnvironment; RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment); - std::unique_ptr wddm(Wddm::createWddm(nullptr, rootDeviceEnvironment)); + auto wddm = Wddm::createWddm(nullptr, rootDeviceEnvironment); auto ret = wddm->init(); EXPECT_FALSE(ret); @@ -1070,18 +1070,19 @@ TEST(WddmGfxPartitionTests, initGfxPartitionHeapStandard64KBSplit) { MockWddm(RootDeviceEnvironment &rootDeviceEnvironment) : Wddm(std::move(OSInterface::discoverDevices(rootDeviceEnvironment.executionEnvironment)[0]), rootDeviceEnvironment) {} }; - MockWddm wddm(*platform()->peekExecutionEnvironment()->rootDeviceEnvironments[0]); + MockExecutionEnvironment executionEnvironment; + auto wddm = new MockWddm(*executionEnvironment.rootDeviceEnvironments[0]); uint32_t rootDeviceIndex = 3; size_t numRootDevices = 5; MockGfxPartition gfxPartition; - wddm.init(); - wddm.initGfxPartition(gfxPartition, rootDeviceIndex, numRootDevices); + wddm->init(); + wddm->initGfxPartition(gfxPartition, rootDeviceIndex, numRootDevices); - auto heapStandard64KBSize = alignDown((wddm.gfxPartition.Standard64KB.Limit - wddm.gfxPartition.Standard64KB.Base + 1) / numRootDevices, GfxPartition::heapGranularity); + auto heapStandard64KBSize = alignDown((wddm->gfxPartition.Standard64KB.Limit - wddm->gfxPartition.Standard64KB.Base + 1) / numRootDevices, GfxPartition::heapGranularity); EXPECT_EQ(heapStandard64KBSize, gfxPartition.getHeapSize(HeapIndex::HEAP_STANDARD64KB)); - EXPECT_EQ(wddm.gfxPartition.Standard64KB.Base + rootDeviceIndex * heapStandard64KBSize, gfxPartition.getHeapBase(HeapIndex::HEAP_STANDARD64KB)); + EXPECT_EQ(wddm->gfxPartition.Standard64KB.Base + rootDeviceIndex * heapStandard64KBSize, gfxPartition.getHeapBase(HeapIndex::HEAP_STANDARD64KB)); } TEST_F(Wddm20Tests, givenWddmWhenDiscoverDevicesAndForceDeviceIdIsTheSameAsTheExistingDeviceThenReturnTheAdapter) { @@ -1402,12 +1403,3 @@ TEST(DiscoverDevices, whenDriverInfoHasIncompatibleDriverStoreThenHwDeviceIdIsNo auto hwDeviceIds = OSInterface::discoverDevices(executionEnvironment); EXPECT_TRUE(hwDeviceIds.empty()); } - -TEST(InitOsInterfaceTest, givenRootDeviceEnvironmentWhenIntializingWddmDuringInitOsInterfaceMethodThenOsInterfaceIsAvailable) { - MockExecutionEnvironment executionEnvironment{}; - auto hwDeviceIds = OSInterface::discoverDevices(executionEnvironment); - EXPECT_EQ(1u, hwDeviceIds.size()); - executionEnvironment.rootDeviceEnvironments[0]->initOsInterface(std::move(hwDeviceIds[0])); - auto wddm = static_cast(executionEnvironment.rootDeviceEnvironments[0]->osInterface->get()->getWddm()); - EXPECT_TRUE(wddm->osInterfaceAvailable); -} diff --git a/opencl/test/unit_test/os_interface/windows/wddm23_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm23_tests.cpp index 82036c6766..b4bd23363f 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm23_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm23_tests.cpp @@ -7,6 +7,7 @@ #include "shared/source/command_stream/preemption.h" #include "shared/source/execution_environment/execution_environment.h" +#include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/helpers/constants.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/os_interface/windows/gdi_interface.h" @@ -29,6 +30,7 @@ struct Wddm23TestsWithoutWddmInit : public ::testing::Test, GdiDllFixture { executionEnvironment = platform()->peekExecutionEnvironment(); wddm = static_cast(Wddm::createWddm(nullptr, *executionEnvironment->rootDeviceEnvironments[0].get())); + auto &osInterface = executionEnvironment->rootDeviceEnvironments[0]->osInterface; osInterface = std::make_unique(); osInterface->get()->setWddm(wddm); @@ -52,7 +54,6 @@ struct Wddm23TestsWithoutWddmInit : public ::testing::Test, GdiDllFixture { GdiDllFixture::TearDown(); } - std::unique_ptr osInterface; std::unique_ptr osContext; WddmMock *wddm = nullptr; WddmMockInterface23 *wddmMockInterface = nullptr; @@ -78,9 +79,9 @@ TEST_F(Wddm23Tests, whenCreateContextIsCalledThenEnableHwQueues) { TEST_F(Wddm23Tests, givenPreemptionModeWhenCreateHwQueueCalledThenSetGpuTimeoutIfEnabled) { auto defaultEngine = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0]; - OsContextWin osContextWithoutPreemption(*osInterface->get()->getWddm(), 0u, 1, defaultEngine, PreemptionMode::Disabled, + OsContextWin osContextWithoutPreemption(*wddm, 0u, 1, defaultEngine, PreemptionMode::Disabled, false, false, false); - OsContextWin osContextWithPreemption(*osInterface->get()->getWddm(), 0u, 1, defaultEngine, PreemptionMode::MidBatch, + OsContextWin osContextWithPreemption(*wddm, 0u, 1, defaultEngine, PreemptionMode::MidBatch, false, false, false); wddm->wddmInterface->createHwQueue(osContextWithoutPreemption); diff --git a/opencl/test/unit_test/os_interface/windows/wddm_address_space_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_address_space_tests.cpp index 473642c883..4447325751 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_address_space_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_address_space_tests.cpp @@ -59,7 +59,7 @@ class WddmMockReserveAddress : public WddmMock { TEST(WddmReserveAddressTest, givenWddmWhenFirstIsSuccessfulThenReturnReserveAddress) { MockExecutionEnvironment executionEnvironment; RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment); - std::unique_ptr wddm(new WddmMockReserveAddress(rootDeviceEnvironment)); + auto wddm = new WddmMockReserveAddress(rootDeviceEnvironment); size_t size = 0x1000; void *reserve = nullptr; @@ -77,7 +77,7 @@ TEST(WddmReserveAddressTest, givenWddmWhenFirstIsSuccessfulThenReturnReserveAddr TEST(WddmReserveAddressTest, givenWddmWhenFirstIsNullThenReturnNull) { MockExecutionEnvironment executionEnvironment; RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment); - std::unique_ptr wddm(new WddmMockReserveAddress(rootDeviceEnvironment)); + auto wddm = new WddmMockReserveAddress(rootDeviceEnvironment); size_t size = 0x1000; void *reserve = nullptr; @@ -91,7 +91,7 @@ TEST(WddmReserveAddressTest, givenWddmWhenFirstIsNullThenReturnNull) { TEST(WddmReserveAddressTest, givenWddmWhenFirstIsInvalidSecondSuccessfulThenReturnSecond) { MockExecutionEnvironment executionEnvironment; RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment); - std::unique_ptr wddm(new WddmMockReserveAddress(rootDeviceEnvironment)); + auto wddm = new WddmMockReserveAddress(rootDeviceEnvironment); size_t size = 0x1000; void *reserve = nullptr; @@ -109,7 +109,7 @@ TEST(WddmReserveAddressTest, givenWddmWhenFirstIsInvalidSecondSuccessfulThenRetu TEST(WddmReserveAddressTest, givenWddmWhenSecondIsInvalidThirdSuccessfulThenReturnThird) { MockExecutionEnvironment executionEnvironment; RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment); - std::unique_ptr wddm(new WddmMockReserveAddress(rootDeviceEnvironment)); + auto wddm = new WddmMockReserveAddress(rootDeviceEnvironment); size_t size = 0x1000; void *reserve = nullptr; @@ -127,7 +127,7 @@ TEST(WddmReserveAddressTest, givenWddmWhenSecondIsInvalidThirdSuccessfulThenRetu TEST(WddmReserveAddressTest, givenWddmWhenFirstIsInvalidSecondNullThenReturnSecondNull) { MockExecutionEnvironment executionEnvironment; RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment); - std::unique_ptr wddm(new WddmMockReserveAddress(rootDeviceEnvironment)); + auto wddm = new WddmMockReserveAddress(rootDeviceEnvironment); size_t size = 0x1000; void *reserve = nullptr; diff --git a/opencl/test/unit_test/os_interface/windows/wddm_fixture.h b/opencl/test/unit_test/os_interface/windows/wddm_fixture.h index 80e9def271..955ff3cc3b 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_fixture.h +++ b/opencl/test/unit_test/os_interface/windows/wddm_fixture.h @@ -102,14 +102,16 @@ struct WddmInstrumentationGmmFixture { void SetUp() { executionEnvironment = platform()->peekExecutionEnvironment(); auto rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[0].get(); - wddm.reset(static_cast(Wddm::createWddm(nullptr, *rootDeviceEnvironment))); + wddm = static_cast(Wddm::createWddm(nullptr, *rootDeviceEnvironment)); gmmMem = new ::testing::NiceMock(rootDeviceEnvironment->getGmmClientContext()); wddm->gmmMemory.reset(gmmMem); + rootDeviceEnvironment->osInterface = std::make_unique(); + rootDeviceEnvironment->osInterface->get()->setWddm(wddm); } void TearDown() { } - std::unique_ptr wddm; + WddmMock *wddm; GmockGmmMemory *gmmMem = nullptr; ExecutionEnvironment *executionEnvironment; }; diff --git a/opencl/test/unit_test/os_interface/windows/wddm_kmdaf_listener_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_kmdaf_listener_tests.cpp index 4f31c635c1..70cde015ff 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_kmdaf_listener_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_kmdaf_listener_tests.cpp @@ -46,15 +46,15 @@ class WddmKmDafListenerTest : public ::testing::Test { auto osEnvironment = new OsEnvironmentWin(); osEnvironment->gdi.reset(new MockGdi()); executionEnvironment->osEnvironment.reset(osEnvironment); - wddmWithKmDafMock.reset(new WddmWithKmDafMock(*rootDeviceEnvironment)); + wddmWithKmDafMock = new WddmWithKmDafMock(*rootDeviceEnvironment); wddmWithKmDafMock->init(); wddmWithKmDafMock->featureTable->ftrKmdDaf = true; } void TearDown() { } - std::unique_ptr wddmWithKmDafMock; - ExecutionEnvironment *executionEnvironment; + WddmWithKmDafMock *wddmWithKmDafMock = nullptr; + ExecutionEnvironment *executionEnvironment = nullptr; RootDeviceEnvironment *rootDeviceEnvironment = nullptr; }; diff --git a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp index 79e77c9bda..2c7fb95d1b 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp @@ -52,8 +52,6 @@ void WddmMemoryManagerFixture::SetUp() { constexpr uint64_t heap32Base = (is32bit) ? 0x1000 : 0x800000000000; wddm->setHeap32(heap32Base, 1000 * MemoryConstants::pageSize - 1); - rootDeviceEnvironment->osInterface = std::make_unique(); - rootDeviceEnvironment->osInterface->get()->setWddm(wddm); rootDeviceEnvironment->memoryOperationsInterface = std::make_unique(wddm); memoryManager = std::make_unique(*executionEnvironment); @@ -352,20 +350,19 @@ TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValuesOnMultipleEnginesRegi for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) { executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get()); } - std::unique_ptr csr(createCommandStream(*executionEnvironment, 1u)); + const uint32_t rootDeviceIndex = 1; + std::unique_ptr csr(createCommandStream(*executionEnvironment, rootDeviceIndex)); - auto wddm2 = static_cast(Wddm::createWddm(nullptr, *executionEnvironment->rootDeviceEnvironments[0].get())); + auto wddm2 = static_cast(Wddm::createWddm(nullptr, *executionEnvironment->rootDeviceEnvironments[rootDeviceIndex].get())); wddm2->init(); - executionEnvironment->rootDeviceEnvironments[1]->osInterface.reset(new OSInterface()); - executionEnvironment->rootDeviceEnvironments[1]->osInterface->get()->setWddm(wddm2); - executionEnvironment->rootDeviceEnvironments[1]->memoryOperationsInterface = std::make_unique(wddm2); + executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface = std::make_unique(wddm2); - auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo(); + auto hwInfo = executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); memoryManager->createAndRegisterOsContext(csr.get(), HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[1], 2, PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false, false, false); ASSERT_EQ(2u, memoryManager->getRegisteredEnginesCount()); - auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0, 32, GraphicsAllocation::AllocationType::BUFFER})); + auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0u, 32, GraphicsAllocation::AllocationType::BUFFER})); auto lastEngineFence = &static_cast(memoryManager->getRegisteredEngines()[1].osContext)->getResidencyController().getMonitoredFence(); allocation->getResidencyData().updateCompletionData(129u, 0u); allocation->getResidencyData().updateCompletionData(152u, 1u); @@ -381,24 +378,23 @@ TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValuesOnMultipleEnginesRegi } TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValueOnSomeOfMultipleEnginesRegisteredWhenHandleFenceCompletionIsCalledThenWaitOnCpuForTheseEngines) { + const uint32_t rootDeviceIndex = 1; executionEnvironment->prepareRootDeviceEnvironments(2u); for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) { executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get()); } - std::unique_ptr csr(createCommandStream(*executionEnvironment, 1u)); + std::unique_ptr csr(createCommandStream(*executionEnvironment, rootDeviceIndex)); - auto wddm2 = static_cast(Wddm::createWddm(nullptr, *executionEnvironment->rootDeviceEnvironments[0].get())); + auto wddm2 = static_cast(Wddm::createWddm(nullptr, *executionEnvironment->rootDeviceEnvironments[rootDeviceIndex].get())); wddm2->init(); - executionEnvironment->rootDeviceEnvironments[1]->osInterface.reset(new OSInterface()); - executionEnvironment->rootDeviceEnvironments[1]->osInterface->get()->setWddm(wddm2); - executionEnvironment->rootDeviceEnvironments[1]->memoryOperationsInterface = std::make_unique(wddm2); + executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface = std::make_unique(wddm2); - auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo(); + auto hwInfo = executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); memoryManager->createAndRegisterOsContext(csr.get(), HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[1], 2, PreemptionHelper::getDefaultPreemptionMode(*hwInfo), false, false, false); ASSERT_EQ(2u, memoryManager->getRegisteredEnginesCount()); - auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0, 32, GraphicsAllocation::AllocationType::BUFFER})); + auto allocation = static_cast(memoryManager->allocateGraphicsMemoryWithProperties({0u, 32, GraphicsAllocation::AllocationType::BUFFER})); auto lastEngineFence = &static_cast(memoryManager->getRegisteredEngines()[0].osContext)->getResidencyController().getMonitoredFence(); allocation->getResidencyData().updateCompletionData(129u, 0u); allocation->getResidencyData().updateCompletionData(0, 1u); @@ -874,15 +870,13 @@ TEST_F(WddmMemoryManagerTest, GivenUnAlignedPointerAndSizeWhenAllocate32BitMemor TEST_F(WddmMemoryManagerTest, getSystemSharedMemory) { executionEnvironment->prepareRootDeviceEnvironments(4u); for (auto i = 0u; i < 4u; i++) { + executionEnvironment->rootDeviceEnvironments[i]->osInterface.reset(); auto mockWddm = Wddm::createWddm(nullptr, *executionEnvironment->rootDeviceEnvironments[i].get()); mockWddm->init(); - executionEnvironment->rootDeviceEnvironments[i]->osInterface = std::make_unique(); - executionEnvironment->rootDeviceEnvironments[i]->osInterface->get()->setWddm(mockWddm); int64_t mem = memoryManager->getSystemSharedMemory(i); EXPECT_EQ(mem, 4249540608); - executionEnvironment->rootDeviceEnvironments[i]->osInterface.reset(); } } @@ -1453,10 +1447,9 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWithRegisteredOsContextWhenC } executionEnvironment->initializeMemoryManager(); for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) { + executionEnvironment->rootDeviceEnvironments[i]->osInterface.reset(); auto wddm = static_cast(Wddm::createWddm(nullptr, *executionEnvironment->rootDeviceEnvironments[i].get())); wddm->init(); - executionEnvironment->rootDeviceEnvironments[i]->osInterface.reset(new OSInterface()); - executionEnvironment->rootDeviceEnvironments[i]->osInterface->get()->setWddm(wddm); executionEnvironment->rootDeviceEnvironments[i]->memoryOperationsInterface = std::make_unique(wddm); } std::unique_ptr csr(createCommandStream(*executionEnvironment, 0u)); @@ -1478,10 +1471,9 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWithRegisteredOsContextWithE } executionEnvironment->initializeMemoryManager(); for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) { + executionEnvironment->rootDeviceEnvironments[i]->osInterface.reset(); auto wddm = static_cast(Wddm::createWddm(nullptr, *executionEnvironment->rootDeviceEnvironments[i].get())); wddm->init(); - executionEnvironment->rootDeviceEnvironments[i]->osInterface.reset(new OSInterface()); - executionEnvironment->rootDeviceEnvironments[i]->osInterface->get()->setWddm(wddm); executionEnvironment->rootDeviceEnvironments[i]->memoryOperationsInterface = std::make_unique(wddm); } std::unique_ptr csr(createCommandStream(*executionEnvironment, 0u)); @@ -1736,8 +1728,6 @@ TEST(WddmMemoryManagerCleanupTest, givenUsedTagAllocationInWddmMemoryManagerWhen auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); wddm->init(); - executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique(); - executionEnvironment.rootDeviceEnvironments[0]->osInterface->get()->setWddm(wddm); executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique(wddm); executionEnvironment.memoryManager = std::make_unique(executionEnvironment); auto osContext = executionEnvironment.memoryManager->createAndRegisterOsContext(csr.get(), aub_stream::ENGINE_RCS, 1, preemptionMode, diff --git a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h index 0bfecdade1..3baa02f11e 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h +++ b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h @@ -61,8 +61,6 @@ class MockWddmMemoryManagerFixture { wddm->setHeap32(heap32Base, 1000 * MemoryConstants::pageSize - 1); wddm->init(); - rootDeviceEnvironment->osInterface.reset(new OSInterface()); - rootDeviceEnvironment->osInterface->get()->setWddm(wddm); rootDeviceEnvironment->memoryOperationsInterface = std::make_unique(wddm); executionEnvironment->initializeMemoryManager(); @@ -110,11 +108,9 @@ class WddmMemoryManagerFixtureWithGmockWddm : public ExecutionEnvironmentFixture // wddm is deleted by memory manager wddm = new NiceMock(*executionEnvironment->rootDeviceEnvironments[0].get()); - executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique(); ASSERT_NE(nullptr, wddm); auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); wddm->init(); - executionEnvironment->rootDeviceEnvironments[0]->osInterface->get()->setWddm(wddm); executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique(wddm); osInterface = executionEnvironment->rootDeviceEnvironments[0]->osInterface.get(); memoryManager = new (std::nothrow) MockWddmMemoryManager(*executionEnvironment); diff --git a/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp index cf33f62de3..467b11e28b 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp @@ -74,7 +74,7 @@ struct WddmResidencyControllerTest : ::testing::Test { void SetUp() { executionEnvironment = std::make_unique(); rootDeviceEnvironment = std::make_unique(*executionEnvironment); - wddm = std::unique_ptr(static_cast(Wddm::createWddm(nullptr, *rootDeviceEnvironment))); + wddm = static_cast(Wddm::createWddm(nullptr, *rootDeviceEnvironment)); wddm->init(); mockOsContextWin = std::make_unique(*wddm, osContextId, 0, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); @@ -84,7 +84,7 @@ struct WddmResidencyControllerTest : ::testing::Test { std::unique_ptr executionEnvironment; std::unique_ptr rootDeviceEnvironment; - std::unique_ptr wddm; + WddmMock *wddm = nullptr; std::unique_ptr mockOsContextWin; MockWddmResidencyController *residencyController = nullptr; }; @@ -95,7 +95,7 @@ struct WddmResidencyControllerWithGdiTest : ::testing::Test { void SetUp() { executionEnvironment = std::make_unique(); rootDeviceEnvironment = std::make_unique(*executionEnvironment); - wddm = std::unique_ptr(static_cast(Wddm::createWddm(nullptr, *rootDeviceEnvironment))); + wddm = static_cast(Wddm::createWddm(nullptr, *rootDeviceEnvironment)); gdi = new MockGdi(); wddm->resetGdi(gdi); wddm->init(); @@ -109,10 +109,10 @@ struct WddmResidencyControllerWithGdiTest : ::testing::Test { std::unique_ptr executionEnvironment; std::unique_ptr rootDeviceEnvironment; - std::unique_ptr wddm; + WddmMock *wddm = nullptr; std::unique_ptr mockOsContextWin; MockWddmResidencyController *residencyController = nullptr; - MockGdi *gdi; + MockGdi *gdi = nullptr; }; struct WddmResidencyControllerWithMockWddmTest : public WddmResidencyControllerTest { @@ -124,8 +124,6 @@ struct WddmResidencyControllerWithMockWddmTest : public WddmResidencyControllerT auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); wddm->init(); - executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique(); - executionEnvironment->rootDeviceEnvironments[0]->osInterface->get()->setWddm(wddm); executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique(wddm); executionEnvironment->initializeMemoryManager(); @@ -163,8 +161,6 @@ struct WddmResidencyControllerWithGdiAndMemoryManagerTest : ::testing::Test { gdi = new MockGdi(); wddm->resetGdi(gdi); - executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique(); - executionEnvironment->rootDeviceEnvironments[0]->osInterface->get()->setWddm(wddm); executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique(wddm); executionEnvironment->initializeMemoryManager(); @@ -199,7 +195,7 @@ TEST(WddmResidencyController, givenWddmResidencyControllerWhenItIsConstructedThe MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); auto gdi = new MockGdi(); - auto wddm = std::unique_ptr{static_cast(Wddm::createWddm(nullptr, *executionEnvironment.rootDeviceEnvironments[0].get()))}; + auto wddm = static_cast(Wddm::createWddm(nullptr, *executionEnvironment.rootDeviceEnvironments[0].get())); wddm->resetGdi(gdi); wddm->init(); @@ -218,7 +214,7 @@ TEST(WddmResidencyController, givenWddmResidencyControllerWhenRegisterCallbackTh MockExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1); auto gdi = new MockGdi(); - auto wddm = std::unique_ptr{static_cast(Wddm::createWddm(nullptr, *executionEnvironment.rootDeviceEnvironments[0].get()))}; + auto wddm = static_cast(Wddm::createWddm(nullptr, *executionEnvironment.rootDeviceEnvironments[0].get())); wddm->resetGdi(gdi); wddm->init(); diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_os_sharing_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_os_sharing_tests.cpp index c3cdd60b91..025fb2436a 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_os_sharing_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_os_sharing_tests.cpp @@ -87,17 +87,19 @@ struct GlArbSyncEventOsTest : public ::testing::Test { sharing.GLContextHandle = 0x2cU; sharing.GLDeviceHandle = 0x3cU; wddm = new WddmMock(*rootDeviceEnvironment); + rootDeviceEnvironment->osInterface = std::make_unique(); + osInterface = rootDeviceEnvironment->osInterface.get(); + osInterface->get()->setWddm(wddm); gdi = new MockGdi(); wddm->resetGdi(gdi); - osInterface.get()->setWddm(wddm); } MockExecutionEnvironment executionEnvironment; std::unique_ptr rootDeviceEnvironment; GlSharingFunctionsMock sharing; MockGdi *gdi = nullptr; WddmMock *wddm = nullptr; - OSInterface osInterface; CL_GL_SYNC_INFO syncInfo = {}; + OSInterface *osInterface = nullptr; }; TEST_F(GlArbSyncEventOsTest, WhenCreateSynchronizationObjectSucceedsThenAllHAndlesAreValid) { @@ -144,7 +146,7 @@ TEST_F(GlArbSyncEventOsTest, WhenCreateSynchronizationObjectSucceedsThenAllHAndl wddm->init(); gdi->createSynchronizationObject.mFunc = CreateSyncObjectMock::createSynchObject; gdi->createSynchronizationObject2.mFunc = CreateSyncObjectMock::createSynchObject2; - auto ret = setupArbSyncObject(sharing, osInterface, syncInfo); + auto ret = setupArbSyncObject(sharing, *osInterface, syncInfo); EXPECT_TRUE(ret); EXPECT_EQ(1U, syncInfo.serverSynchronizationObject); EXPECT_EQ(2U, syncInfo.clientSynchronizationObject); @@ -155,7 +157,7 @@ TEST_F(GlArbSyncEventOsTest, WhenCreateSynchronizationObjectSucceedsThenAllHAndl EXPECT_NE(nullptr, syncInfo.submissionEvent); EXPECT_NE(nullptr, syncInfo.submissionEventName); EXPECT_FALSE(syncInfo.waitCalled); - cleanupArbSyncObject(osInterface, &syncInfo); + cleanupArbSyncObject(*osInterface, &syncInfo); } TEST_F(GlArbSyncEventOsTest, GivenNewGlSyncInfoWhenCreateSynchronizationObjectFailsThenSetupArbSyncObjectFails) { @@ -198,19 +200,21 @@ TEST_F(GlArbSyncEventOsTest, GivenNewGlSyncInfoWhenCreateSynchronizationObjectFa CreateSyncObjectMock::getFailHandleId() = CreateSyncObjectMock::getHandle(); int failuresCount = 0; - auto ret = setupArbSyncObject(sharing, osInterface, syncInfo); + auto ret = setupArbSyncObject(sharing, *osInterface, syncInfo); while (false == ret) { ++failuresCount; CreateSyncObjectMock::getHandle() = 1; ++CreateSyncObjectMock::getFailHandleId(); - ret = setupArbSyncObject(sharing, osInterface, syncInfo); + ret = setupArbSyncObject(sharing, *osInterface, syncInfo); } EXPECT_EQ(3, failuresCount); - cleanupArbSyncObject(osInterface, &syncInfo); + cleanupArbSyncObject(*osInterface, &syncInfo); } TEST_F(GlArbSyncEventOsTest, GivenNewGlSyncInfoWhenCreateEventFailsThenSetupArbSyncObjectFails) { auto rootDeviceEnvironment = platform()->peekExecutionEnvironment()->rootDeviceEnvironments[0].get(); + rootDeviceEnvironment->osInterface = std::make_unique(); + MockOSInterface mockOsInterface; MockOSInterfaceImpl *mockOsInterfaceImpl = static_cast(mockOsInterface.get()); @@ -242,6 +246,7 @@ TEST_F(GlArbSyncEventOsTest, GivenInvalidGlSyncInfoWhenCleanupArbSyncObjectIsCal } }; auto rootDeviceEnvironment = platform()->peekExecutionEnvironment()->rootDeviceEnvironments[0].get(); + rootDeviceEnvironment->osInterface = std::make_unique(); auto wddm = new WddmMock(*rootDeviceEnvironment); auto gdi = new MockGdi(); @@ -272,6 +277,7 @@ TEST_F(GlArbSyncEventOsTest, GivenValidGlSyncInfoWhenCleanupArbSyncObjectIsCalle } }; auto rootDeviceEnvironment = platform()->peekExecutionEnvironment()->rootDeviceEnvironments[0].get(); + rootDeviceEnvironment->osInterface = std::make_unique(); auto wddm = new WddmMock(*rootDeviceEnvironment); auto gdi = new MockGdi(); @@ -336,7 +342,7 @@ TEST_F(GlArbSyncEventOsTest, GivenCallToSignalArbSyncObjectWhenSignalSynchroniza FailSignalSyncObjectMock::reset(); auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); wddm->init(); - OsContextWin osContext(*osInterface.get()->getWddm(), 0u, 1, + OsContextWin osContext(*wddm, 0u, 1, HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0], preemptionMode, false, false, false); @@ -397,7 +403,7 @@ TEST_F(GlArbSyncEventOsTest, GivenCallToSignalArbSyncObjectWhenSignalSynchroniza FailSignalSyncObjectMock::reset(); auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); wddm->init(); - OsContextWin osContext(*osInterface.get()->getWddm(), 0u, 1, + OsContextWin osContext(*wddm, 0u, 1, HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0], preemptionMode, false, false, false); @@ -451,7 +457,7 @@ TEST_F(GlArbSyncEventOsTest, GivenCallToServerWaitForArbSyncObjectWhenWaitForSyn gdi->waitForSynchronizationObject.mFunc = FailWaitSyncObjectMock::waitForSynchObject; EXPECT_FALSE(syncInfo.waitCalled); - serverWaitForArbSyncObject(osInterface, syncInfo); + serverWaitForArbSyncObject(*osInterface, syncInfo); EXPECT_FALSE(syncInfo.waitCalled); } @@ -460,6 +466,6 @@ TEST_F(GlArbSyncEventOsTest, GivenCallToServerWaitForArbSyncObjectWhenWaitForSyn syncInfo.serverSynchronizationObject = 0x7cU; EXPECT_FALSE(syncInfo.waitCalled); - serverWaitForArbSyncObject(osInterface, syncInfo); + serverWaitForArbSyncObject(*osInterface, syncInfo); EXPECT_TRUE(syncInfo.waitCalled); } diff --git a/opencl/test/unit_test/windows/os_interface_tests.cpp b/opencl/test/unit_test/windows/os_interface_tests.cpp index 0a47a31704..4367108271 100644 --- a/opencl/test/unit_test/windows/os_interface_tests.cpp +++ b/opencl/test/unit_test/windows/os_interface_tests.cpp @@ -22,9 +22,9 @@ TEST(osInterfaceTests, whenOsInterfaceSetupGmmInputArgsThenProperAdapterBDFIsSet MockExecutionEnvironment executionEnvironment; RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment); auto wddm = new WddmMock(rootDeviceEnvironment); - OSInterface osInterface; - osInterface.get()->setWddm(wddm); + EXPECT_EQ(nullptr, rootDeviceEnvironment.osInterface.get()); wddm->init(); + EXPECT_NE(nullptr, rootDeviceEnvironment.osInterface.get()); auto &adapterBDF = wddm->adapterBDF; adapterBDF.Bus = 0x12; @@ -33,6 +33,6 @@ TEST(osInterfaceTests, whenOsInterfaceSetupGmmInputArgsThenProperAdapterBDFIsSet GMM_INIT_IN_ARGS gmmInputArgs = {}; EXPECT_NE(0, memcmp(&adapterBDF, &gmmInputArgs.stAdapterBDF, sizeof(ADAPTER_BDF))); - osInterface.setGmmInputArgs(&gmmInputArgs); + rootDeviceEnvironment.osInterface->setGmmInputArgs(&gmmInputArgs); EXPECT_EQ(0, memcmp(&adapterBDF, &gmmInputArgs.stAdapterBDF, sizeof(ADAPTER_BDF))); } diff --git a/shared/source/os_interface/windows/os_interface.cpp b/shared/source/os_interface/windows/os_interface.cpp index a9d54f1faa..fb3e09d489 100644 --- a/shared/source/os_interface/windows/os_interface.cpp +++ b/shared/source/os_interface/windows/os_interface.cpp @@ -71,8 +71,6 @@ BOOL OSInterface::OSInterfaceImpl::closeHandle(HANDLE hObject) { } bool RootDeviceEnvironment::initOsInterface(std::unique_ptr &&hwDeviceId) { auto wddm(Wddm::createWddm(std::move(hwDeviceId), *this)); - osInterface = std::make_unique(); - osInterface->get()->setWddm(wddm); if (!wddm->init()) { return false; } diff --git a/shared/source/os_interface/windows/wddm/wddm.cpp b/shared/source/os_interface/windows/wddm/wddm.cpp index 4d135dc416..aadb6e5f7f 100644 --- a/shared/source/os_interface/windows/wddm/wddm.cpp +++ b/shared/source/os_interface/windows/wddm/wddm.cpp @@ -67,6 +67,10 @@ Wddm::~Wddm() { } bool Wddm::init() { + if (!rootDeviceEnvironment.osInterface) { + rootDeviceEnvironment.osInterface = std::make_unique(); + rootDeviceEnvironment.osInterface->get()->setWddm(this); + } if (!queryAdapterInfo()) { return false; } diff --git a/shared/source/os_interface/windows/wddm/wddm.h b/shared/source/os_interface/windows/wddm/wddm.h index 65a609c22d..a3cda0420d 100644 --- a/shared/source/os_interface/windows/wddm/wddm.h +++ b/shared/source/os_interface/windows/wddm/wddm.h @@ -52,7 +52,7 @@ class Wddm { virtual ~Wddm(); static Wddm *createWddm(std::unique_ptr hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment); - MOCKABLE_VIRTUAL bool init(); + bool init(); MOCKABLE_VIRTUAL bool evict(const D3DKMT_HANDLE *handleList, uint32_t numOfHandles, uint64_t &sizeToTrim); MOCKABLE_VIRTUAL bool makeResident(const D3DKMT_HANDLE *handles, uint32_t count, bool cantTrimFurther, uint64_t *numberOfBytesToTrim, size_t totalSize);