Skip to content

Commit bab9ad6

Browse files
Wddm interface [3/n]: Improve constructing Wddm object
- Only Wddm object owns Gdi - Dont pass Gdi object to constructor - Move Wddm related files to new directory Change-Id: Iadd26634c7692db760d7d3367211c32d2c2c8121
1 parent 06287af commit bab9ad6

28 files changed

+163
-171
lines changed

runtime/dll/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ set(RUNTIME_SRCS_DLL_WINDOWS
5555
${IGDRCL_SOURCE_DIR}/runtime/gmm_helper/gmm_memory.cpp
5656
${IGDRCL_SOURCE_DIR}/runtime/gmm_helper/page_table_mngr.cpp
5757
${IGDRCL_SOURCE_DIR}/runtime/os_interface/windows/sys_calls.cpp
58-
${IGDRCL_SOURCE_DIR}/runtime/os_interface/windows/wddm_create.cpp
58+
${IGDRCL_SOURCE_DIR}/runtime/os_interface/windows/wddm/wddm_create.cpp
5959
)
6060

6161
target_sources(${NEO_DYNAMIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_DLL_BASE})

runtime/gen8/windows/wddm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, Intel Corporation
2+
* Copyright (c) 2017 - 2018, Intel Corporation
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),
@@ -21,8 +21,8 @@
2121
*/
2222

2323
#include "hw_cmds.h"
24-
#include "runtime/os_interface/windows/wddm.h"
25-
#include "runtime/os_interface/windows/wddm.inl"
24+
#include "runtime/os_interface/windows/wddm/wddm.h"
25+
#include "runtime/os_interface/windows/wddm/wddm.inl"
2626

2727
namespace OCLRT {
2828

runtime/gen9/windows/wddm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, Intel Corporation
2+
* Copyright (c) 2017 - 2018, Intel Corporation
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),
@@ -21,8 +21,8 @@
2121
*/
2222

2323
#include "hw_cmds.h"
24-
#include "runtime/os_interface/windows/wddm.h"
25-
#include "runtime/os_interface/windows/wddm.inl"
24+
#include "runtime/os_interface/windows/wddm/wddm.h"
25+
#include "runtime/os_interface/windows/wddm/wddm.inl"
2626

2727
namespace OCLRT {
2828

runtime/os_interface/windows/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ set(RUNTIME_SRCS_OS_INTERFACE_WINDOWS
5656
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger_windows.cpp
5757
${CMAKE_CURRENT_SOURCE_DIR}/sys_calls.h
5858
${CMAKE_CURRENT_SOURCE_DIR}/thk_wrapper.h
59-
${CMAKE_CURRENT_SOURCE_DIR}/wddm.cpp
60-
${CMAKE_CURRENT_SOURCE_DIR}/wddm.h
61-
${CMAKE_CURRENT_SOURCE_DIR}/wddm.inl
6259
${CMAKE_CURRENT_SOURCE_DIR}/wddm_32bit_memory.cpp
6360
${CMAKE_CURRENT_SOURCE_DIR}/wddm_allocation.h
6461
${CMAKE_CURRENT_SOURCE_DIR}/wddm_device_command_stream.h
@@ -71,6 +68,9 @@ set(RUNTIME_SRCS_OS_INTERFACE_WINDOWS
7168
${CMAKE_CURRENT_SOURCE_DIR}/windows_inc.cpp
7269
${CMAKE_CURRENT_SOURCE_DIR}/windows_wrapper.h
7370
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config.cpp
71+
${CMAKE_CURRENT_SOURCE_DIR}/wddm/wddm.cpp
72+
${CMAKE_CURRENT_SOURCE_DIR}/wddm/wddm.h
73+
${CMAKE_CURRENT_SOURCE_DIR}/wddm/wddm.inl
7474
)
7575

7676
if(WIN32)

runtime/os_interface/windows/deferrable_deletion_win.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, Intel Corporation
2+
* Copyright (c) 2017 - 2018, Intel Corporation
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),
@@ -20,7 +20,7 @@
2020
* OTHER DEALINGS IN THE SOFTWARE.
2121
*/
2222

23-
#include "runtime/os_interface/windows/wddm.h"
23+
#include "runtime/os_interface/windows/wddm/wddm.h"
2424
#include "runtime/os_interface/windows/deferrable_deletion_win.h"
2525

2626
namespace OCLRT {

runtime/os_interface/windows/device_factory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "runtime/os_interface/device_factory.h"
2727
#include "runtime/os_interface/hw_info_config.h"
2828
#include "runtime/os_interface/windows/os_interface.h"
29-
#include "runtime/os_interface/windows/wddm.h"
29+
#include "runtime/os_interface/windows/wddm/wddm.h"
3030

3131
namespace OCLRT {
3232

runtime/os_interface/windows/driver_info.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, Intel Corporation
2+
* Copyright (c) 2017 - 2018, Intel Corporation
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),
@@ -20,7 +20,7 @@
2020
* OTHER DEALINGS IN THE SOFTWARE.
2121
*/
2222

23-
#include "runtime/os_interface/windows/wddm.h"
23+
#include "runtime/os_interface/windows/wddm/wddm.h"
2424
#include "runtime/device/driver_info.h"
2525
#include "runtime/os_interface/windows/driver_info.h"
2626
#include "runtime/os_interface/windows/os_interface.h"

runtime/os_interface/windows/os_interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include "os_interface.h"
2424

25-
#include "runtime/os_interface/windows/wddm.h"
25+
#include "runtime/os_interface/windows/wddm/wddm.h"
2626
#include "runtime/os_interface/windows/sys_calls.h"
2727

2828
namespace OCLRT {

runtime/os_interface/windows/os_time.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222

2323
#include <memory>
24-
#include "runtime/os_interface/windows/wddm.h"
24+
#include "runtime/os_interface/windows/wddm/wddm.h"
2525
#include "runtime/os_interface/windows/os_interface.h"
2626
#include "runtime/os_interface/windows/os_time.h"
2727

runtime/os_interface/windows/wddm.cpp renamed to runtime/os_interface/windows/wddm/wddm.cpp

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "runtime/gmm_helper/gmm_helper.h"
2828
#include "runtime/gmm_helper/resource_info.h"
2929
#include "runtime/gmm_helper/page_table_mngr.h"
30-
#include "runtime/os_interface/windows/wddm.h"
30+
#include "runtime/os_interface/windows/wddm/wddm.h"
3131
#include "runtime/os_interface/hw_info_config.h"
3232
#include "runtime/os_interface/windows/wddm_allocation.h"
3333
#include "runtime/os_interface/windows/registry_reader.h"
@@ -53,18 +53,16 @@ Wddm::GetSystemInfoFcn Wddm::getSystemInfo = getGetSystemInfo();
5353
Wddm::VirtualAllocFcn Wddm::virtualAllocFnc = getVirtualAlloc();
5454
Wddm::VirtualFreeFcn Wddm::virtualFreeFnc = getVirtualFree();
5555

56-
Wddm::Wddm(Gdi *gdi) : initialized(false),
57-
gdiAllocated(false),
58-
gdi(gdi),
59-
adapter(0),
60-
context(0),
61-
device(0),
62-
pagingQueue(0),
63-
pagingQueueSyncObject(0),
64-
pagingFenceAddress(nullptr),
65-
currentPagingFenceValue(0),
66-
hwContextId(0),
67-
trimCallbackHandle(nullptr) {
56+
Wddm::Wddm() : initialized(false),
57+
adapter(0),
58+
context(0),
59+
device(0),
60+
pagingQueue(0),
61+
pagingQueueSyncObject(0),
62+
pagingFenceAddress(nullptr),
63+
currentPagingFenceValue(0),
64+
hwContextId(0),
65+
trimCallbackHandle(nullptr) {
6866
featureTable.reset(new FeatureTable());
6967
waTable.reset(new WorkaroundTable());
7068
gtSystemInfo.reset(new GT_SYSTEM_INFO);
@@ -81,10 +79,7 @@ Wddm::Wddm(Gdi *gdi) : initialized(false),
8179
gmmMemory = std::unique_ptr<GmmMemory>(GmmMemory::create());
8280
minAddress = 0;
8381
kmDafListener = std::unique_ptr<KmDafListener>(new KmDafListener);
84-
}
85-
86-
Wddm::Wddm() : Wddm(new Gdi()) {
87-
gdiAllocated = true;
82+
gdi = std::unique_ptr<Gdi>(new Gdi());
8883
}
8984

9085
Wddm::~Wddm() {
@@ -95,8 +90,6 @@ Wddm::~Wddm() {
9590
destroyPagingQueue();
9691
destroyDevice();
9792
closeAdapter();
98-
if (gdiAllocated)
99-
delete gdi;
10093
}
10194

10295
bool Wddm::enumAdapters(unsigned int devNum, HardwareInfo &outHardwareInfo) {

0 commit comments

Comments
 (0)