Skip to content

Commit 931ed38

Browse files
[3/n] Wddm Cleanup.
- remove different flavors of Wddm - rename files for better meaning - remove unnecessary files - remove unnecessary methods Change-Id: I73a35e186a9a99169260bb157958ff795b36e20d
1 parent 077134f commit 931ed38

28 files changed

+60
-238
lines changed

runtime/os_interface/windows/device_factory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ bool DeviceFactory::getDevices(HardwareInfo **pHWInfos, size_t &numDevices, Exec
4545
numDevices = 0;
4646

4747
while (numDevices < totalDeviceCount) {
48-
std::unique_ptr<Wddm> wddm(Wddm ::createWddm(Wddm::pickWddmInterfaceVersion(tempHwInfos[numDevices])));
48+
std::unique_ptr<Wddm> wddm(Wddm ::createWddm());
4949
if (!wddm->enumAdapters(tempHwInfos[numDevices])) {
5050
return false;
5151
}

runtime/os_interface/windows/wddm/wddm.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -909,13 +909,4 @@ void Wddm::resetMonitoredFenceParams(D3DKMT_HANDLE &handle, uint64_t *cpuAddress
909909
monitoredFence.cpuAddress = cpuAddress;
910910
monitoredFence.gpuAddress = gpuAddress;
911911
}
912-
913-
WddmInterfaceVersion Wddm::pickWddmInterfaceVersion(const HardwareInfo &hwInfo) {
914-
if (hwInfo.pSkuTable && hwInfo.pSkuTable->ftrWddmHwQueues) {
915-
return WddmInterfaceVersion::Wddm23;
916-
}
917-
// Use default version when hwInfo is not yet populated (eg. during enumAdapter call)
918-
return WddmInterfaceVersion::Wddm20;
919-
}
920-
921912
} // namespace OCLRT

runtime/os_interface/windows/wddm/wddm.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ class Wddm {
6363

6464
virtual ~Wddm();
6565

66-
static Wddm *createWddm(WddmInterfaceVersion interfaceVersion);
67-
static WddmInterfaceVersion pickWddmInterfaceVersion(const HardwareInfo &hwInfo);
66+
static Wddm *createWddm();
6867
bool enumAdapters(HardwareInfo &outHardwareInfo);
6968

7069
MOCKABLE_VIRTUAL bool evict(D3DKMT_HANDLE *handleList, uint32_t numOfHandles, uint64_t &sizeToTrim);
@@ -223,7 +222,4 @@ class Wddm {
223222
std::unique_ptr<KmDafListener> kmDafListener;
224223
std::unique_ptr<WddmInterface> wddmInterface;
225224
};
226-
227-
using Wddm20 = Wddm;
228-
229225
} // namespace OCLRT

runtime/os_interface/windows/wddm/wddm23.cpp

Lines changed: 0 additions & 29 deletions
This file was deleted.

runtime/os_interface/windows/wddm/wddm23.h

Lines changed: 0 additions & 35 deletions
This file was deleted.

runtime/os_interface/windows/wddm/wddm_create.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,9 @@
2222

2323
#include "runtime/os_interface/debug_settings_manager.h"
2424
#include "runtime/os_interface/windows/wddm/wddm.h"
25-
#include "runtime/os_interface/windows/wddm/wddm23.h"
2625

2726
namespace OCLRT {
28-
Wddm *Wddm::createWddm(WddmInterfaceVersion interfaceVersion) {
29-
switch (interfaceVersion) {
30-
case WddmInterfaceVersion::Wddm20:
31-
return new Wddm20();
32-
case WddmInterfaceVersion::Wddm23:
33-
return new Wddm23();
34-
default:
35-
UNRECOVERABLE_IF(true);
36-
return nullptr;
37-
}
27+
Wddm *Wddm::createWddm() {
28+
return new Wddm();
3829
}
3930
} // namespace OCLRT

runtime/os_interface/windows/wddm_device_command_stream.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ WddmCommandStreamReceiver<GfxFamily>::WddmCommandStreamReceiver(const HardwareIn
5252
: BaseClass(hwInfoIn, executionEnvironment) {
5353
this->wddm = wddm;
5454
if (this->wddm == nullptr) {
55-
this->wddm = Wddm::createWddm(Wddm::pickWddmInterfaceVersion(hwInfoIn));
55+
this->wddm = Wddm::createWddm();
5656
}
5757
GPUNODE_ORDINAL nodeOrdinal = GPUNODE_3D;
5858
UNRECOVERABLE_IF(!WddmEngineMapper<GfxFamily>::engineNodeMap(hwInfoIn.capabilityTable.defaultEngineType, nodeOrdinal));

unit_tests/device/device_win_timers_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "unit_tests/mocks/mock_ostime.h"
2424
#include "unit_tests/fixtures/device_fixture.h"
2525
#include "unit_tests/mocks/mock_ostime_win.h"
26-
#include "unit_tests/mocks/mock_wddm20.h"
26+
#include "unit_tests/mocks/mock_wddm.h"
2727
#include "test.h"
2828

2929
using namespace OCLRT;

unit_tests/mocks/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ if(WIN32)
7979
${CMAKE_CURRENT_SOURCE_DIR}/gmm_memory${BRANCH_DIR_SUFFIX}/mock_gmm_memory.h
8080
${CMAKE_CURRENT_SOURCE_DIR}/mock_gmm_page_table_mngr.h
8181
${CMAKE_CURRENT_SOURCE_DIR}/mock_gmm_page_table_mngr.cpp
82+
${CMAKE_CURRENT_SOURCE_DIR}/mock_wddm_interface23.h
83+
${CMAKE_CURRENT_SOURCE_DIR}/mock_wddm.h
84+
${CMAKE_CURRENT_SOURCE_DIR}/mock_wddm.cpp
8285
${IGDRCL_SRC_tests_mock_wddm}
8386
)
8487
else()
Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "runtime/helpers/aligned_memory.h"
2424
#include "runtime/os_interface/windows/gdi_interface.h"
2525
#include "runtime/os_interface/windows/wddm_allocation.h"
26-
#include "unit_tests/mocks/mock_wddm20.h"
26+
#include "unit_tests/mocks/mock_wddm.h"
2727
#include "unit_tests/mock_gdi/mock_gdi.h"
2828

2929
#include "gtest/gtest.h"
@@ -237,38 +237,3 @@ bool WddmMock::reserveValidAddressRange(size_t size, void *&reservedMem) {
237237
GmmMemory *WddmMock::getGmmMemory() const {
238238
return gmmMemory.get();
239239
}
240-
241-
bool WddmMock::initializeWithoutConfiguringAddressSpace() {
242-
if (gdi != nullptr && gdi->isInitialized() && !initialized) {
243-
if (!openAdapter()) {
244-
return false;
245-
}
246-
if (!queryAdapterInfo()) {
247-
return false;
248-
}
249-
250-
if (featureTable->ftrWddmHwQueues) {
251-
wddmInterface = std::make_unique<WddmInterface23>(*this);
252-
} else {
253-
wddmInterface = std::make_unique<WddmInterface20>(*this);
254-
}
255-
256-
if (!createDevice()) {
257-
return false;
258-
}
259-
if (!createPagingQueue()) {
260-
return false;
261-
}
262-
if (!createContext()) {
263-
return false;
264-
}
265-
if (wddmInterface->hwQueuesSupported() && !wddmInterface->createHwQueue(preemptionMode)) {
266-
return false;
267-
}
268-
if (!wddmInterface->createMonitoredFence()) {
269-
return false;
270-
}
271-
initialized = true;
272-
}
273-
return initialized;
274-
}

0 commit comments

Comments
 (0)