mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-20 13:11:34 +08:00
fix: Process OpaqueWin32 external semaphore properly
Related-To: NEO-11488 Signed-off-by: Raiyan Latif <raiyan.latif@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
e244b6e07f
commit
12e3204cab
@ -8,7 +8,6 @@ set(NEO_CORE_GLOBAL_FACTORIES
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/create_os_context_${DRIVER_MODEL}.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/create_os_context_${DRIVER_MODEL}.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/create_os_time_${DRIVER_MODEL}.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/create_os_time_${DRIVER_MODEL}.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/discover_devices_${DRIVER_MODEL}.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/discover_devices_${DRIVER_MODEL}.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/external_semaphore_${DRIVER_MODEL}.cpp
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/init_os_interface_${DRIVER_MODEL}.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/init_os_interface_${DRIVER_MODEL}.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2025 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "shared/source/os_interface/external_semaphore.h"
|
|
||||||
#include "shared/source/os_interface/windows/external_semaphore_windows.h"
|
|
||||||
|
|
||||||
#include <limits>
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace NEO {
|
|
||||||
|
|
||||||
std::unique_ptr<ExternalSemaphore> ExternalSemaphore::create(OSInterface *osInterface, ExternalSemaphore::Type type, void *handle, int fd) {
|
|
||||||
if (osInterface) {
|
|
||||||
if (osInterface->getDriverModel()->getDriverModelType() == DriverModelType::wddm) {
|
|
||||||
auto externalSemaphore = ExternalSemaphoreWindows::create(osInterface);
|
|
||||||
|
|
||||||
bool result = externalSemaphore->importSemaphore(handle, fd, 0, nullptr, type, false);
|
|
||||||
if (result == false) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
return externalSemaphore;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace NEO
|
|
@ -1,34 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2025 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "shared/source/os_interface/external_semaphore.h"
|
|
||||||
#include "shared/source/os_interface/windows/external_semaphore_windows.h"
|
|
||||||
|
|
||||||
#include <limits>
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace NEO {
|
|
||||||
|
|
||||||
std::unique_ptr<ExternalSemaphore> ExternalSemaphore::create(OSInterface *osInterface, ExternalSemaphore::Type type, void *handle, int fd) {
|
|
||||||
if (osInterface) {
|
|
||||||
if (osInterface->getDriverModel()->getDriverModelType() == DriverModelType::wddm) {
|
|
||||||
auto externalSemaphore = ExternalSemaphoreWindows::create(osInterface);
|
|
||||||
|
|
||||||
bool result = externalSemaphore->importSemaphore(handle, fd, 0, nullptr, type, false);
|
|
||||||
if (result == false) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
return externalSemaphore;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace NEO
|
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2019-2024 Intel Corporation
|
# Copyright (C) 2019-2025 Intel Corporation
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
#
|
#
|
||||||
@ -43,6 +43,7 @@ set(NEO_CORE_OS_INTERFACE_LINUX
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/drm_wrappers_checks.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/drm_wrappers_checks.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/drm_wrappers.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/drm_wrappers.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/drm_wrappers.h
|
${CMAKE_CURRENT_SOURCE_DIR}/drm_wrappers.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/external_semaphore_linux.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_drm.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_drm.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/file_descriptor.h
|
${CMAKE_CURRENT_SOURCE_DIR}/file_descriptor.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper_linux.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper_linux.cpp
|
||||||
|
@ -7,14 +7,10 @@
|
|||||||
|
|
||||||
#include "shared/source/os_interface/external_semaphore.h"
|
#include "shared/source/os_interface/external_semaphore.h"
|
||||||
|
|
||||||
#include <limits>
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
|
|
||||||
std::unique_ptr<ExternalSemaphore> ExternalSemaphore::create(OSInterface *osInterface, ExternalSemaphore::Type type, void *handle, int fd) {
|
std::unique_ptr<ExternalSemaphore> ExternalSemaphore::create(OSInterface *osInterface, ExternalSemaphore::Type type, void *handle, int fd) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace NEO
|
} // namespace NEO
|
@ -18,6 +18,8 @@ set(NEO_CORE_OS_INTERFACE_WINDOWS
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}driver_info_windows_impl.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}driver_info_windows_impl.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/driver_info_windows.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/driver_info_windows.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/driver_info_windows.h
|
${CMAKE_CURRENT_SOURCE_DIR}/driver_info_windows.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/external_semaphore_windows.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/external_semaphore_windows.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper_win.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper_win.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_drm_stub.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_drm_stub.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/kmd_notify_properties_windows.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/kmd_notify_properties_windows.cpp
|
||||||
@ -64,8 +66,6 @@ set(NEO_CORE_OS_INTERFACE_WDDM
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/device_time_wddm.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/device_time_wddm.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/device_time_wddm.h
|
${CMAKE_CURRENT_SOURCE_DIR}/device_time_wddm.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/driver_info_windows.h
|
${CMAKE_CURRENT_SOURCE_DIR}/driver_info_windows.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/external_semaphore_windows.cpp
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/external_semaphore_windows.h
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/gdi_interface.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/gdi_interface.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/gdi_interface.h
|
${CMAKE_CURRENT_SOURCE_DIR}/gdi_interface.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/gdi_interface_logging.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/gdi_interface_logging.cpp
|
||||||
|
@ -11,11 +11,40 @@
|
|||||||
#include "shared/source/os_interface/windows/d3dkmthk_wrapper.h"
|
#include "shared/source/os_interface/windows/d3dkmthk_wrapper.h"
|
||||||
#include "shared/source/os_interface/windows/gdi_interface.h"
|
#include "shared/source/os_interface/windows/gdi_interface.h"
|
||||||
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
||||||
|
#include "shared/source/os_interface/windows/windows_wrapper.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
typedef VOID(NTAPI *_RtlInitUnicodeString)(PUNICODE_STRING destinationString, PCWSTR sourceString);
|
||||||
|
typedef VOID(NTAPI *_NtOpenDirectoryObject)(PHANDLE directoryHandle, ACCESS_MASK desiredAccess, POBJECT_ATTRIBUTES objectAttributes);
|
||||||
|
|
||||||
|
typedef wchar_t SharedSyncName[9 + 2 * (sizeof(uint32_t) + sizeof(uint64_t))];
|
||||||
|
|
||||||
|
struct SharedMemoryContentHeader {
|
||||||
|
alignas(8) uint64_t lastSignaledValue;
|
||||||
|
SharedSyncName sharedSyncName;
|
||||||
|
uint32_t access;
|
||||||
|
uint32_t serializedSecurityDescriptorStringSize;
|
||||||
|
};
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
|
|
||||||
|
std::unique_ptr<ExternalSemaphore> ExternalSemaphore::create(OSInterface *osInterface, ExternalSemaphore::Type type, void *handle, int fd) {
|
||||||
|
if (osInterface) {
|
||||||
|
if (osInterface->getDriverModel()->getDriverModelType() == DriverModelType::wddm) {
|
||||||
|
auto externalSemaphore = ExternalSemaphoreWindows::create(osInterface);
|
||||||
|
|
||||||
|
bool result = externalSemaphore->importSemaphore(handle, fd, 0, nullptr, type, false);
|
||||||
|
if (result == false) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return externalSemaphore;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
std::unique_ptr<ExternalSemaphoreWindows> ExternalSemaphoreWindows::create(OSInterface *osInterface) {
|
std::unique_ptr<ExternalSemaphoreWindows> ExternalSemaphoreWindows::create(OSInterface *osInterface) {
|
||||||
auto extSemWindows = std::make_unique<ExternalSemaphoreWindows>();
|
auto extSemWindows = std::make_unique<ExternalSemaphoreWindows>();
|
||||||
extSemWindows->osInterface = osInterface;
|
extSemWindows->osInterface = osInterface;
|
||||||
@ -40,6 +69,53 @@ bool ExternalSemaphoreWindows::importSemaphore(void *extHandle, int fd, uint32_t
|
|||||||
|
|
||||||
syncNtHandle = reinterpret_cast<HANDLE>(extHandle);
|
syncNtHandle = reinterpret_cast<HANDLE>(extHandle);
|
||||||
|
|
||||||
|
if (type == ExternalSemaphore::OpaqueWin32) {
|
||||||
|
auto moduleHandle = GetModuleHandleA("ntdll.dll");
|
||||||
|
_RtlInitUnicodeString rtlInitUnicodeString = (_RtlInitUnicodeString)GetProcAddress(moduleHandle, "RtlInitUnicodeString");
|
||||||
|
_NtOpenDirectoryObject ntOpenDirectoryObject = (_NtOpenDirectoryObject)GetProcAddress(moduleHandle, "NtOpenDirectoryObject");
|
||||||
|
|
||||||
|
HANDLE rootDirectory;
|
||||||
|
OBJECT_ATTRIBUTES objectAttributesRootDirectory;
|
||||||
|
UNICODE_STRING unicodeNameRootDirectory;
|
||||||
|
PUNICODE_STRING pUnicodeNameRootDirectory = NULL;
|
||||||
|
|
||||||
|
wchar_t baseName[] = L"\\BaseNamedObjects";
|
||||||
|
rtlInitUnicodeString(&unicodeNameRootDirectory, baseName);
|
||||||
|
pUnicodeNameRootDirectory = &unicodeNameRootDirectory;
|
||||||
|
InitializeObjectAttributes(&objectAttributesRootDirectory, pUnicodeNameRootDirectory, 0, nullptr, nullptr);
|
||||||
|
ntOpenDirectoryObject(&rootDirectory, 0x0004 /* DIRECTORY_CREATE_OBJECT */, &objectAttributesRootDirectory);
|
||||||
|
|
||||||
|
auto pCpuAddress = MapViewOfFile(syncNtHandle, FILE_MAP_WRITE | FILE_MAP_READ, 0, 0, 0);
|
||||||
|
|
||||||
|
auto sharedMemoryContentHeader = *reinterpret_cast<SharedMemoryContentHeader *>(pCpuAddress);
|
||||||
|
auto access = sharedMemoryContentHeader.access;
|
||||||
|
auto pSyncName = &sharedMemoryContentHeader.sharedSyncName[0];
|
||||||
|
syncNtHandle = nullptr;
|
||||||
|
|
||||||
|
OBJECT_ATTRIBUTES objectAttributes;
|
||||||
|
UNICODE_STRING unicodeName;
|
||||||
|
|
||||||
|
PUNICODE_STRING pUnicodeName = NULL;
|
||||||
|
const wchar_t *pName = reinterpret_cast<wchar_t *>(pSyncName);
|
||||||
|
|
||||||
|
if (pName) {
|
||||||
|
rtlInitUnicodeString(&unicodeName, pName);
|
||||||
|
pUnicodeName = &unicodeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
InitializeObjectAttributes(&objectAttributes, pUnicodeName, 0, rootDirectory, nullptr);
|
||||||
|
|
||||||
|
D3DKMT_OPENSYNCOBJECTNTHANDLEFROMNAME openName = {};
|
||||||
|
openName.dwDesiredAccess = access;
|
||||||
|
openName.pObjAttrib = &objectAttributes;
|
||||||
|
auto status = wddm->getGdi()->openSyncObjectNtHandleFromName(&openName);
|
||||||
|
if (status != STATUS_SUCCESS) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
syncNtHandle = openName.hNtHandle;
|
||||||
|
}
|
||||||
|
|
||||||
D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 open = {};
|
D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 open = {};
|
||||||
open.hNtHandle = syncNtHandle;
|
open.hNtHandle = syncNtHandle;
|
||||||
open.hDevice = wddm->getDeviceHandle();
|
open.hDevice = wddm->getDeviceHandle();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2024 Intel Corporation
|
* Copyright (C) 2018-2025 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@ -66,6 +66,7 @@ bool Gdi::getAllProcAddresses() {
|
|||||||
waitForSynchronizationObjectFromGpu = gdiDll->getProcAddress("D3DKMTWaitForSynchronizationObjectFromGpu");
|
waitForSynchronizationObjectFromGpu = gdiDll->getProcAddress("D3DKMTWaitForSynchronizationObjectFromGpu");
|
||||||
signalSynchronizationObjectFromGpu = gdiDll->getProcAddress("D3DKMTSignalSynchronizationObjectFromGpu");
|
signalSynchronizationObjectFromGpu = gdiDll->getProcAddress("D3DKMTSignalSynchronizationObjectFromGpu");
|
||||||
openSyncObjectFromNtHandle2 = gdiDll->getProcAddress("D3DKMTOpenSyncObjectFromNtHandle2");
|
openSyncObjectFromNtHandle2 = gdiDll->getProcAddress("D3DKMTOpenSyncObjectFromNtHandle2");
|
||||||
|
openSyncObjectNtHandleFromName = gdiDll->getProcAddress("D3DKMTOpenSyncObjectNtHandleFromName");
|
||||||
createPagingQueue = gdiDll->getProcAddress("D3DKMTCreatePagingQueue");
|
createPagingQueue = gdiDll->getProcAddress("D3DKMTCreatePagingQueue");
|
||||||
destroyPagingQueue = gdiDll->getProcAddress("D3DKMTDestroyPagingQueue");
|
destroyPagingQueue = gdiDll->getProcAddress("D3DKMTDestroyPagingQueue");
|
||||||
lock2 = gdiDll->getProcAddress("D3DKMTLock2");
|
lock2 = gdiDll->getProcAddress("D3DKMTLock2");
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2024 Intel Corporation
|
* Copyright (C) 2018-2025 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@ -53,6 +53,7 @@ class Gdi {
|
|||||||
DEFINE_THK_WRAPPER(IN CONST D3DKMT_WAITFORSYNCHRONIZATIONOBJECTFROMGPU *, waitForSynchronizationObjectFromGpu);
|
DEFINE_THK_WRAPPER(IN CONST D3DKMT_WAITFORSYNCHRONIZATIONOBJECTFROMGPU *, waitForSynchronizationObjectFromGpu);
|
||||||
DEFINE_THK_WRAPPER(IN CONST D3DKMT_SIGNALSYNCHRONIZATIONOBJECTFROMGPU *, signalSynchronizationObjectFromGpu);
|
DEFINE_THK_WRAPPER(IN CONST D3DKMT_SIGNALSYNCHRONIZATIONOBJECTFROMGPU *, signalSynchronizationObjectFromGpu);
|
||||||
DEFINE_THK_WRAPPER(IN OUT D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 *, openSyncObjectFromNtHandle2);
|
DEFINE_THK_WRAPPER(IN OUT D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 *, openSyncObjectFromNtHandle2);
|
||||||
|
DEFINE_THK_WRAPPER(IN OUT D3DKMT_OPENSYNCOBJECTNTHANDLEFROMNAME *, openSyncObjectNtHandleFromName);
|
||||||
DEFINE_THK_WRAPPER(IN OUT D3DKMT_CREATEPAGINGQUEUE *, createPagingQueue);
|
DEFINE_THK_WRAPPER(IN OUT D3DKMT_CREATEPAGINGQUEUE *, createPagingQueue);
|
||||||
DEFINE_THK_WRAPPER(IN OUT D3DDDI_DESTROYPAGINGQUEUE *, destroyPagingQueue);
|
DEFINE_THK_WRAPPER(IN OUT D3DDDI_DESTROYPAGINGQUEUE *, destroyPagingQueue);
|
||||||
DEFINE_THK_WRAPPER(IN OUT D3DKMT_LOCK2 *, lock2);
|
DEFINE_THK_WRAPPER(IN OUT D3DKMT_LOCK2 *, lock2);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2022-2023 Intel Corporation
|
* Copyright (C) 2022-2025 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@ -232,6 +232,11 @@ void getEnterString<D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 *>(D3DKMT_OPENSYNCOBJECTF
|
|||||||
snprintf_s(input, size, size, "D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 Flags 0x%x", param->Flags.Value);
|
snprintf_s(input, size, size, "D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 Flags 0x%x", param->Flags.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
void getEnterString<D3DKMT_OPENSYNCOBJECTNTHANDLEFROMNAME *>(D3DKMT_OPENSYNCOBJECTNTHANDLEFROMNAME *param, char *input, size_t size) {
|
||||||
|
strcpy_s(input, size, "D3DKMT_OPENSYNCOBJECTNTHANDLEFROMNAME");
|
||||||
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void getEnterString<CONST D3DKMT_DESTROYALLOCATION2 *>(CONST D3DKMT_DESTROYALLOCATION2 *param, char *input, size_t size) {
|
void getEnterString<CONST D3DKMT_DESTROYALLOCATION2 *>(CONST D3DKMT_DESTROYALLOCATION2 *param, char *input, size_t size) {
|
||||||
snprintf_s(input, size, size, "D3DKMT_DESTROYALLOCATION2 Flags 0x%x", param->Flags.Value);
|
snprintf_s(input, size, size, "D3DKMT_DESTROYALLOCATION2 Flags 0x%x", param->Flags.Value);
|
||||||
@ -428,6 +433,9 @@ template void logExit<CONST D3DKMT_SUBMITCOMMAND *>(NTSTATUS status, CONST D3DKM
|
|||||||
template void logEnter<D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 *>(D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 *param);
|
template void logEnter<D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 *>(D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 *param);
|
||||||
template void logExit<D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 *>(NTSTATUS status, D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 *param);
|
template void logExit<D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 *>(NTSTATUS status, D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 *param);
|
||||||
|
|
||||||
|
template void logEnter<D3DKMT_OPENSYNCOBJECTNTHANDLEFROMNAME *>(D3DKMT_OPENSYNCOBJECTNTHANDLEFROMNAME *param);
|
||||||
|
template void logExit<D3DKMT_OPENSYNCOBJECTNTHANDLEFROMNAME *>(NTSTATUS status, D3DKMT_OPENSYNCOBJECTNTHANDLEFROMNAME *param);
|
||||||
|
|
||||||
template void logEnter<CONST D3DKMT_DESTROYALLOCATION2 *>(CONST D3DKMT_DESTROYALLOCATION2 *param);
|
template void logEnter<CONST D3DKMT_DESTROYALLOCATION2 *>(CONST D3DKMT_DESTROYALLOCATION2 *param);
|
||||||
template void logExit<CONST D3DKMT_DESTROYALLOCATION2 *>(NTSTATUS status, CONST D3DKMT_DESTROYALLOCATION2 *param);
|
template void logExit<CONST D3DKMT_DESTROYALLOCATION2 *>(NTSTATUS status, CONST D3DKMT_DESTROYALLOCATION2 *param);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2024 Intel Corporation
|
* Copyright (C) 2018-2025 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@ -673,6 +673,10 @@ NTSTATUS __stdcall mockD3DKMTOpenSyncObjectFromNtHandle2(IN OUT D3DKMT_OPENSYNCO
|
|||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NTSTATUS __stdcall mockD3DKMTOpenSyncObjectNtHandleFromName(IN OUT D3DKMT_OPENSYNCOBJECTNTHANDLEFROMNAME *) {
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
NTSTATUS __stdcall mockD3DKMTFreeGpuVirtualAddress(IN CONST D3DKMT_FREEGPUVIRTUALADDRESS *) {
|
NTSTATUS __stdcall mockD3DKMTFreeGpuVirtualAddress(IN CONST D3DKMT_FREEGPUVIRTUALADDRESS *) {
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2024 Intel Corporation
|
* Copyright (C) 2018-2025 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@ -74,6 +74,7 @@ NTSTATUS __stdcall mockD3DKMTSignalSynchronizationObjectFromCpu(IN CONST D3DKMT_
|
|||||||
NTSTATUS __stdcall mockD3DKMTWaitForSynchronizationObjectFromGpu(IN CONST D3DKMT_WAITFORSYNCHRONIZATIONOBJECTFROMGPU *);
|
NTSTATUS __stdcall mockD3DKMTWaitForSynchronizationObjectFromGpu(IN CONST D3DKMT_WAITFORSYNCHRONIZATIONOBJECTFROMGPU *);
|
||||||
NTSTATUS __stdcall mockD3DKMTSignalSynchronizationObjectFromGpu(IN CONST D3DKMT_SIGNALSYNCHRONIZATIONOBJECTFROMGPU *);
|
NTSTATUS __stdcall mockD3DKMTSignalSynchronizationObjectFromGpu(IN CONST D3DKMT_SIGNALSYNCHRONIZATIONOBJECTFROMGPU *);
|
||||||
NTSTATUS __stdcall mockD3DKMTOpenSyncObjectFromNtHandle2(IN OUT D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 *);
|
NTSTATUS __stdcall mockD3DKMTOpenSyncObjectFromNtHandle2(IN OUT D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 *);
|
||||||
|
NTSTATUS __stdcall mockD3DKMTOpenSyncObjectNtHandleFromName(IN OUT D3DKMT_OPENSYNCOBJECTNTHANDLEFROMNAME *);
|
||||||
NTSTATUS __stdcall mockD3DKMTFreeGpuVirtualAddress(IN CONST D3DKMT_FREEGPUVIRTUALADDRESS *);
|
NTSTATUS __stdcall mockD3DKMTFreeGpuVirtualAddress(IN CONST D3DKMT_FREEGPUVIRTUALADDRESS *);
|
||||||
NTSTATUS __stdcall mockD3DKMTUpdateGpuVirtualAddress(IN CONST D3DKMT_UPDATEGPUVIRTUALADDRESS *);
|
NTSTATUS __stdcall mockD3DKMTUpdateGpuVirtualAddress(IN CONST D3DKMT_UPDATEGPUVIRTUALADDRESS *);
|
||||||
NTSTATUS __stdcall mockD3DKMTSubmitCommand(IN CONST D3DKMT_SUBMITCOMMAND *);
|
NTSTATUS __stdcall mockD3DKMTSubmitCommand(IN CONST D3DKMT_SUBMITCOMMAND *);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2022-2024 Intel Corporation
|
* Copyright (C) 2022-2025 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@ -232,6 +232,9 @@ void *MockOsLibrary::getProcAddress(const std::string &procName) {
|
|||||||
if (procName == "D3DKMTOpenSyncObjectFromNtHandle2") {
|
if (procName == "D3DKMTOpenSyncObjectFromNtHandle2") {
|
||||||
return reinterpret_cast<void *>(mockD3DKMTOpenSyncObjectFromNtHandle2);
|
return reinterpret_cast<void *>(mockD3DKMTOpenSyncObjectFromNtHandle2);
|
||||||
}
|
}
|
||||||
|
if (procName == "D3DKMTOpenSyncObjectNtHandleFromName") {
|
||||||
|
return reinterpret_cast<void *>(mockD3DKMTOpenSyncObjectNtHandleFromName);
|
||||||
|
}
|
||||||
if (procName == "D3DKMTFreeGpuVirtualAddress") {
|
if (procName == "D3DKMTFreeGpuVirtualAddress") {
|
||||||
return reinterpret_cast<void *>(mockD3DKMTFreeGpuVirtualAddress);
|
return reinterpret_cast<void *>(mockD3DKMTFreeGpuVirtualAddress);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2022-2023 Intel Corporation
|
* Copyright (C) 2022-2025 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@ -1037,6 +1037,30 @@ TEST_F(GdiInterfaceLoggingTest, WhenGdiLoggingIsEnabledWhenLoggingOpenSyncObject
|
|||||||
EXPECT_STREQ(expectedOutput.str().c_str(), logExitStr.c_str());
|
EXPECT_STREQ(expectedOutput.str().c_str(), logExitStr.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(GdiInterfaceLoggingTest, WhenGdiLoggingIsEnabledWhenLoggingOpenSyncObjectNtHandleFromNameThenExpectCorrectStrings) {
|
||||||
|
D3DKMT_OPENSYNCOBJECTNTHANDLEFROMNAME param = {};
|
||||||
|
|
||||||
|
std::stringstream expectedOutput;
|
||||||
|
expectedOutput << logEnterBegin
|
||||||
|
<< "D3DKMT_OPENSYNCOBJECTNTHANDLEFROMNAME"
|
||||||
|
<< std::endl;
|
||||||
|
|
||||||
|
testing::internal::CaptureStdout();
|
||||||
|
GdiLogging::logEnter<D3DKMT_OPENSYNCOBJECTNTHANDLEFROMNAME *>(¶m);
|
||||||
|
std::string logEnterStr = testing::internal::GetCapturedStdout();
|
||||||
|
EXPECT_STREQ(expectedOutput.str().c_str(), logEnterStr.c_str());
|
||||||
|
|
||||||
|
expectedOutput.str(std::string());
|
||||||
|
expectedOutput << logExitBegin
|
||||||
|
<< std::hex << status
|
||||||
|
<< " " << std::endl;
|
||||||
|
|
||||||
|
testing::internal::CaptureStdout();
|
||||||
|
GdiLogging::logExit<D3DKMT_OPENSYNCOBJECTNTHANDLEFROMNAME *>(status, ¶m);
|
||||||
|
std::string logExitStr = testing::internal::GetCapturedStdout();
|
||||||
|
EXPECT_STREQ(expectedOutput.str().c_str(), logExitStr.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(GdiInterfaceLoggingTest, WhenGdiLoggingIsEnabledWhenLoggingDestroyAllocation2ThenExpectCorrectStrings) {
|
TEST_F(GdiInterfaceLoggingTest, WhenGdiLoggingIsEnabledWhenLoggingDestroyAllocation2ThenExpectCorrectStrings) {
|
||||||
D3DKMT_DESTROYALLOCATION2 param = {};
|
D3DKMT_DESTROYALLOCATION2 param = {};
|
||||||
param.Flags.SynchronousDestroy = 1;
|
param.Flags.SynchronousDestroy = 1;
|
||||||
|
Reference in New Issue
Block a user