2121#include " core/utilities/stackvec.h"
2222#include " runtime/execution_environment/execution_environment.h"
2323#include " runtime/gmm_helper/gmm.h"
24+ #include " runtime/helpers/windows/gmm_callbacks.h"
2425#include " runtime/memory_manager/memory_manager.h"
2526#include " runtime/os_interface/hw_info_config.h"
2627#include " runtime/os_interface/windows/gdi_interface.h"
@@ -938,7 +939,37 @@ int Wddm::virtualFree(void *ptr, size_t size, unsigned long flags) {
938939 return virtualFreeFnc (ptr, size, flags);
939940}
940941
941- bool Wddm::configureDeviceAddressSpaceImpl () {
942+ long __stdcall notifyAubCapture (void *csrHandle, uint64_t gfxAddress, size_t gfxSize, bool allocate) {
943+ return notifyAubCaptureImpl (csrHandle, gfxAddress, gfxSize, allocate);
944+ }
945+ bool Wddm::configureDeviceAddressSpace () {
946+ GMM_DEVICE_CALLBACKS_INT deviceCallbacks{};
947+ deviceCallbacks.Adapter .KmtHandle = adapter;
948+ deviceCallbacks.hCsr = nullptr ;
949+ deviceCallbacks.hDevice .KmtHandle = device;
950+ deviceCallbacks.PagingQueue = pagingQueue;
951+ deviceCallbacks.PagingFence = pagingQueueSyncObject;
952+
953+ deviceCallbacks.DevCbPtrs .KmtCbPtrs .pfnAllocate = gdi->createAllocation ;
954+ deviceCallbacks.DevCbPtrs .KmtCbPtrs .pfnDeallocate = gdi->destroyAllocation ;
955+ deviceCallbacks.DevCbPtrs .KmtCbPtrs .pfnMapGPUVA = gdi->mapGpuVirtualAddress ;
956+ deviceCallbacks.DevCbPtrs .KmtCbPtrs .pfnMakeResident = gdi->makeResident ;
957+ deviceCallbacks.DevCbPtrs .KmtCbPtrs .pfnEvict = gdi->evict ;
958+ deviceCallbacks.DevCbPtrs .KmtCbPtrs .pfnReserveGPUVA = gdi->reserveGpuVirtualAddress ;
959+ deviceCallbacks.DevCbPtrs .KmtCbPtrs .pfnUpdateGPUVA = gdi->updateGpuVirtualAddress ;
960+ deviceCallbacks.DevCbPtrs .KmtCbPtrs .pfnWaitFromCpu = gdi->waitForSynchronizationObjectFromCpu ;
961+ deviceCallbacks.DevCbPtrs .KmtCbPtrs .pfnLock = gdi->lock2 ;
962+ deviceCallbacks.DevCbPtrs .KmtCbPtrs .pfnUnLock = gdi->unlock2 ;
963+ deviceCallbacks.DevCbPtrs .KmtCbPtrs .pfnEscape = gdi->escape ;
964+ deviceCallbacks.DevCbPtrs .KmtCbPtrs .pfnFreeGPUVA = gdi->freeGpuVirtualAddress ;
965+ deviceCallbacks.DevCbPtrs .KmtCbPtrs .pfnNotifyAubCapture = notifyAubCapture;
966+
967+ GMM_DEVICE_INFO deviceInfo{};
968+ deviceInfo.pGfxPartition = &gfxPartition;
969+ deviceInfo.pDeviceCb = &deviceCallbacks;
970+ if (!gmmMemory->setDeviceInfo (&deviceInfo)) {
971+ return false ;
972+ }
942973 SYSTEM_INFO sysInfo;
943974 Wddm::getSystemInfo (&sysInfo);
944975 maximumApplicationAddress = reinterpret_cast <uintptr_t >(sysInfo.lpMaximumApplicationAddress );
@@ -950,7 +981,8 @@ bool Wddm::configureDeviceAddressSpaceImpl() {
950981 ? maximumApplicationAddress + 1u
951982 : 0u ;
952983
953- return gmmMemory->configureDevice (adapter, device, gdi->escape , svmSize, featureTable->ftrL3IACoherency , gfxPartition, minAddress);
984+ bool obtainMinAddress = gfxPlatform->eRenderCoreFamily == IGFX_GEN12LP_CORE;
985+ return gmmMemory->configureDevice (adapter, device, gdi->escape , svmSize, featureTable->ftrL3IACoherency , minAddress, obtainMinAddress);
954986}
955987
956988void Wddm::waitOnPagingFenceFromCpu () {
0 commit comments