mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 21:42:53 +08:00
Verify HDC handle when returning devices for GL sharing
Resolves: NEO-4952 Change-Id: I298bb26aacd2cc5ad7206f7fff2b2235098fb8bf Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
c2a4835943
commit
418db08517
@@ -22,7 +22,7 @@ inline const std::string getGdiName() {
|
||||
Gdi::Gdi() : gdiDll(getGdiName()),
|
||||
initialized(false) {
|
||||
if (gdiDll.isLoaded()) {
|
||||
initialized = getAllProcAddresses();
|
||||
initialized = Gdi::getAllProcAddresses();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1059,4 +1059,15 @@ void Wddm::createPagingFenceLogger() {
|
||||
}
|
||||
}
|
||||
|
||||
bool Wddm::verifyHdcHandle(size_t hdcHandle) const {
|
||||
D3DKMT_OPENADAPTERFROMHDC openAdapterFromHdcStruct{};
|
||||
openAdapterFromHdcStruct.hDc = reinterpret_cast<HDC>(hdcHandle);
|
||||
auto status = getGdi()->openAdapterFromHdc(&openAdapterFromHdcStruct);
|
||||
if (STATUS_SUCCESS != status) {
|
||||
DEBUG_BREAK_IF(true);
|
||||
return false;
|
||||
}
|
||||
return openAdapterFromHdcStruct.AdapterLuid.HighPart == hwDeviceId->getAdapterLuid().HighPart && openAdapterFromHdcStruct.AdapterLuid.LowPart == hwDeviceId->getAdapterLuid().LowPart;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -92,6 +92,8 @@ class Wddm {
|
||||
|
||||
bool configureDeviceAddressSpace();
|
||||
|
||||
MOCKABLE_VIRTUAL bool verifyHdcHandle(size_t hdcHandle) const;
|
||||
|
||||
GT_SYSTEM_INFO *getGtSysInfo() const {
|
||||
DEBUG_BREAK_IF(!gtSystemInfo);
|
||||
return gtSystemInfo.get();
|
||||
|
||||
Reference in New Issue
Block a user