Files
compute-runtime/runtime/os_interface/windows/os_context_win.cpp
Dunajski, Bartosz c0c6a46ece Wddm 2.3 improvements
- Dont create synchronization object manually - take it from HW queue
- Construct MonitoredFence from HwQueue object
- D3DKMT_SUBMITCOMMANDTOHWQUEUE should get currentFenceValue
instead of its handle
- Dont pass MonitoredFenceVa/Value in cmd buffer header

Change-Id: I4717119379cef2f0e641ce9f4ef614089491a85d
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
Related-To: NEO-3728
2019-09-13 10:27:04 +02:00

47 lines
1.6 KiB
C++

/*
* Copyright (C) 2018-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/os_interface/windows/os_context_win.h"
#include "runtime/os_interface/windows/os_interface.h"
#include "runtime/os_interface/windows/wddm/wddm.h"
#include "runtime/os_interface/windows/wddm/wddm_interface.h"
namespace NEO {
OsContext *OsContext::create(OSInterface *osInterface, uint32_t contextId, DeviceBitfield deviceBitfield,
aub_stream::EngineType engineType, PreemptionMode preemptionMode, bool lowPriority) {
if (osInterface) {
return new OsContextWin(*osInterface->get()->getWddm(), contextId, deviceBitfield, engineType, preemptionMode, lowPriority);
}
return new OsContext(contextId, deviceBitfield, engineType, preemptionMode, lowPriority);
}
OsContextWin::OsContextWin(Wddm &wddm, uint32_t contextId, DeviceBitfield deviceBitfield,
aub_stream::EngineType engineType, PreemptionMode preemptionMode, bool lowPriority)
: OsContext(contextId, deviceBitfield, engineType, preemptionMode, lowPriority), wddm(wddm), residencyController(wddm, contextId) {
auto wddmInterface = wddm.getWddmInterface();
if (!wddm.createContext(*this)) {
return;
}
if (wddmInterface->hwQueuesSupported()) {
if (!wddmInterface->createHwQueue(*this)) {
return;
}
}
initialized = wddmInterface->createMonitoredFence(*this);
residencyController.registerCallback();
};
OsContextWin::~OsContextWin() {
wddm.getWddmInterface()->destroyHwQueue(hardwareQueue.handle);
wddm.destroyContext(wddmContextHandle);
}
} // namespace NEO