20
20
* OTHER DEALINGS IN THE SOFTWARE.
21
21
*/
22
22
23
+ #include " runtime/memory_manager/memory_constants.h"
23
24
#include " runtime/os_interface/windows/gdi_interface.h"
24
25
#include " runtime/os_interface/windows/wddm/wddm_interface.h"
25
26
#include " runtime/os_interface/windows/wddm/wddm.h"
26
27
#include " runtime/os_interface/windows/os_context_win.h"
27
28
28
- bool OCLRT::WddmInterface20::createHwQueue (PreemptionMode preemptionMode, OsContextWin &osContext) {
29
+ using namespace OCLRT ;
30
+
31
+ bool WddmInterface20::createHwQueue (PreemptionMode preemptionMode, OsContextWin &osContext) {
29
32
return false ;
30
33
}
31
- void OCLRT:: WddmInterface20::destroyHwQueue (D3DKMT_HANDLE hwQueue) {}
34
+ void WddmInterface20::destroyHwQueue (D3DKMT_HANDLE hwQueue) {}
32
35
33
- bool OCLRT::WddmInterface20 ::createMonitoredFence (OsContextWin &osContext) {
36
+ bool WddmInterface ::createMonitoredFence (OsContextWin &osContext) {
34
37
NTSTATUS Status;
35
38
D3DKMT_CREATESYNCHRONIZATIONOBJECT2 CreateSynchronizationObject = {0 };
36
39
CreateSynchronizationObject.hDevice = wddm.getDevice ();
@@ -48,11 +51,11 @@ bool OCLRT::WddmInterface20::createMonitoredFence(OsContextWin &osContext) {
48
51
return Status == STATUS_SUCCESS;
49
52
}
50
53
51
- const bool OCLRT:: WddmInterface20::hwQueuesSupported () {
54
+ const bool WddmInterface20::hwQueuesSupported () {
52
55
return false ;
53
56
}
54
57
55
- bool OCLRT:: WddmInterface20::submit (uint64_t commandBuffer, size_t size, void *commandHeader, OsContextWin &osContext) {
58
+ bool WddmInterface20::submit (uint64_t commandBuffer, size_t size, void *commandHeader, OsContextWin &osContext) {
56
59
D3DKMT_SUBMITCOMMAND SubmitCommand = {0 };
57
60
NTSTATUS status = STATUS_SUCCESS;
58
61
@@ -77,7 +80,7 @@ bool OCLRT::WddmInterface20::submit(uint64_t commandBuffer, size_t size, void *c
77
80
return STATUS_SUCCESS == status;
78
81
}
79
82
80
- bool OCLRT:: WddmInterface23::createHwQueue (PreemptionMode preemptionMode, OsContextWin &osContext) {
83
+ bool WddmInterface23::createHwQueue (PreemptionMode preemptionMode, OsContextWin &osContext) {
81
84
D3DKMT_CREATEHWQUEUE createHwQueue = {};
82
85
83
86
if (!wddm.getGdi ()->setupHwQueueProcAddresses ()) {
@@ -93,14 +96,10 @@ bool OCLRT::WddmInterface23::createHwQueue(PreemptionMode preemptionMode, OsCont
93
96
UNRECOVERABLE_IF (status != STATUS_SUCCESS);
94
97
osContext.setHwQueue (createHwQueue.hHwQueue );
95
98
96
- osContext.resetMonitoredFenceParams (createHwQueue.hHwQueueProgressFence ,
97
- reinterpret_cast <uint64_t *>(createHwQueue.HwQueueProgressFenceCPUVirtualAddress ),
98
- createHwQueue.HwQueueProgressFenceGPUVirtualAddress );
99
-
100
99
return status == STATUS_SUCCESS;
101
100
}
102
101
103
- void OCLRT:: WddmInterface23::destroyHwQueue (D3DKMT_HANDLE hwQueue) {
102
+ void WddmInterface23::destroyHwQueue (D3DKMT_HANDLE hwQueue) {
104
103
if (hwQueue) {
105
104
D3DKMT_DESTROYHWQUEUE destroyHwQueue = {};
106
105
destroyHwQueue.hHwQueue = hwQueue;
@@ -110,15 +109,11 @@ void OCLRT::WddmInterface23::destroyHwQueue(D3DKMT_HANDLE hwQueue) {
110
109
}
111
110
}
112
111
113
- bool OCLRT::WddmInterface23::createMonitoredFence (OsContextWin &osContext) {
114
- return true ;
115
- }
116
-
117
- const bool OCLRT::WddmInterface23::hwQueuesSupported () {
112
+ const bool WddmInterface23::hwQueuesSupported () {
118
113
return true ;
119
114
}
120
115
121
- bool OCLRT:: WddmInterface23::submit (uint64_t commandBuffer, size_t size, void *commandHeader, OsContextWin &osContext) {
116
+ bool WddmInterface23::submit (uint64_t commandBuffer, size_t size, void *commandHeader, OsContextWin &osContext) {
122
117
auto monitoredFence = osContext.getMonitoredFence ();
123
118
124
119
D3DKMT_SUBMITCOMMANDTOHWQUEUE submitCommand = {};
@@ -132,7 +127,7 @@ bool OCLRT::WddmInterface23::submit(uint64_t commandBuffer, size_t size, void *c
132
127
pHeader->MonitorFenceValue = monitoredFence.currentFenceValue ;
133
128
134
129
submitCommand.pPrivateDriverData = commandHeader;
135
- submitCommand.PrivateDriverDataSize = sizeof (COMMAND_BUFFER_HEADER) ;
130
+ submitCommand.PrivateDriverDataSize = MemoryConstants::pageSize ;
136
131
137
132
auto status = wddm.getGdi ()->submitCommandToHwQueue (&submitCommand);
138
133
UNRECOVERABLE_IF (status != STATUS_SUCCESS);
0 commit comments